constraint vs necessity

constraint

noun
  • An irresistible force or compulsion. 

  • A condition that a solution to an optimization problem must satisfy. 

  • A linkage or other restriction that maintains database integrity. 

  • The repression of one's feelings. 

  • Something that constrains; a restriction. 

necessity

noun
  • Something which makes an act or an event unavoidable; an irresistible force; overruling power. 

  • Greater utilitarian good; used in justification of a criminal act. 

  • Indispensable requirements (of life). 

  • The negation of freedom in voluntary action; the subjection of all phenomena, whether material or spiritual, to inevitable causation; necessitarianism. 

  • The condition of being needy; desperate need; lack. 

  • Something necessary; a requisite; something indispensable. 

  • The quality or state of being necessary, unavoidable, or absolutely requisite. 

How often have the words constraint and necessity occurred in a corpus of books? (source: Google Ngram Viewer )