What is Constraint: Definition and 184 Discussions

Constraint programming (CP) is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. In constraint programming, users declaratively state the constraints on the feasible solutions for a set of decision variables. Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found. In addition to constraints, users also need to specify a method to solve these constraints. This typically draws upon standard methods like chronological backtracking and constraint propagation, but may use customized code like a problem specific branching heuristic.
Constraint programming takes its root from and can be expressed in the form of constraint logic programming, which embeds constraints into a logic program. This variant of logic programming is due to Jaffar and Lassez, who extended in 1987 a specific class of constraints that were introduced in Prolog II. The first implementations of constraint logic programming were Prolog III, CLP(R), and CHIP.
Instead of logic programming, constraints can be mixed with functional programming, term rewriting, and imperative languages.
Programming languages with built-in support for constraints include Oz (functional programming) and Kaleidoscope (imperative programming). Mostly, constraints are implemented in imperative languages via constraint solving toolkits, which are separate libraries for an existing imperative language.

View More On Wikipedia.org
  1. deuteron

    Bead moving down a Helical Wire subject to Constraints

    One of the constraints is given as ##r=R##, which is very obvious. The second constraint is however given as $$\phi - \frac {2\pi} h z=0$$ where ##h## is the increase of ##z## in one turn of the helix. Physically, I can't see where this constraint comes from and how ##\phi=\frac {2\pi}h z##.
  2. deuteron

    I Constraint Forces and Lagrange Multipliers

    My question is about the general relationship between the constraint functions and the constraint forces, but I found it easier to explain my problem over the example of a double pendulum: Consider a double pendulum with the generalized coordinates ##q=\{l_1,\theta_1,l_2,\theta_2\}##,: The...
  3. Andrea Vironda

    Calculating constraint reactions

    I would be interested in calculating the constraint reactions on the 6 pads in yellow in the figure, about 300mm apart among them and loaded with F=12500 kN in blue. Since the system is highly hyperstatic, I don't know how to calculate the constraints. Can you give me a hand? I've made a FEM...
  4. theshape89

    Describing Rolling Constraint for Rolling Disk With No Slipping

    Let ##R=\sqrt{x^{2} + y^{2}}##. Then \begin{align}v_{tangential}&=\frac{dR}{dt} \nonumber\\ &=\frac{dR}{dx}\frac{dy}{dt} + \frac{dR}{dy}\frac{dy}{dt} \nonumber\\ &=\frac{x}{R}\frac{dx}{dt} + \frac{y}{R}\frac{dy}{dt} \nonumber\\ &= cos\phi \frac{dx}{dt} + sin\phi \frac{dy}{dt}.\nonumber...
  5. Ahmed1029

    I Virtual work and constraint forces

    Suppose I'm considering a system of N particles that are constrained in their possible motions and so there are less that 3N generalized coordinates. Suppose now I perform a virtual displacement on one particle, which due to some constraints might force some other particles to more virtually...
  6. M

    Optimization: Dual for L1 norm minimization with equality constraint

    Hi, I was reading through some notes on standard problems and their corresponding dual problems. I came across the L2 norm minimization for an equality constraint, and then I thought how one might formulate the dual problem if we had an L1-norm instead. Question: Consider the following...
  7. guyvsdcsniper

    Analyzing a constraint eqn for a pulley system

    I am having trouble creating the constraint equation for this pulley system. I don't understand why the last 3 variables of the following constraint is divided by 2? Could anyone help me understand why this is?
  8. johnsmith7565

    Engineering Finding the constraint equation of a circuit with a dependent voltage

    What I’m stuck on is finding the constraint equation for i on the top question . I don’t know how to find it when it’s through a voltage source and not over any resistors. (I can’t use ohm‘s law) After I find i the problem should become easy to solve. I know that v1 = 10 and v2 = 20i . The KCL...
  9. Addez123

    Unsolvable max/min of surface with constraint

    Trying first with lagrange multiplier ##grad(f) = (2x + y, 2y + x)## ##g = x^4 + y^4 -8 = 0## ##grad(g) = (4x^3, 4y^3)## $$grad(f) = \lambda grad(g)$$ gives us 2 equations (1) ##2x + y = \lambda4x^3## (2) ##2y + x = \lambda4y^3## From (1) we get ##y = \lambda4x^3 - 2x## insert that into (2) and...
  10. person123

    Constraint Programming(ish) For Engineering Design

    I've been working on a tool in a browser for engineering (particularly civil engineering) design. By design, I just mean finding values (maybe the cross-section or material of a beam) which satisfies constraints. You would define constraints, possibly have something to minimize or maximize (like...
  11. AfonsoDeAlbuquerque

    A Triangulating Hamiltonian Constraint in LQG

    Im trying to obtain regularized (and triangulated) version of Hamiltonian constraint in the LQG. However, one step remains unclear to me. I am starting with the Euclidean Hamiltonian:$$H_E=\frac{2}{\kappa} \int_\Sigma d^3 x N(x)\epsilon^{abc} \text{Tr}(F_{ab},\{A_c,V\}) $$ Now i have to...
  12. T

    A Hamilton's Method with Lagrange Equation and Constraint

    Good Morning I am "comfortable" with formulating Hamilton's Principle with a Lagrangian (KE - PE), conducting the calculus of variations and obtaining the Euler Lagrange Equations. Advanced mathematical theory, is beyond me. I also have a minimal understanding of using Lagrange multipliers...
  13. Philip Koeck

    A Volume constraint in micro-canonical derivation of statistical physics

    Another question about the use of the micro-canonical ensemble in deriving distributions. On the Wikipedia-page the authors mention that the total volume of the system has to be constant. See...
  14. K

    A Hamilton's principle and virtual work by constraint forces

    Found a question on another website, I have the exact same question. Please help me Goldstein says : I do not understand how (2.34) shows that the virtual work done by forces of constraint is zero. How does the fact that "the same Hamilton's principle holds for both holonomic and...
  15. LCSphysicist

    Motion of Rolling Cylinder in Fixed Cylinder: Confusing Constraint Condition

    The problem is a classical one, basically to find the equations of motion of cylinder of radius a inside a fixed cylinder of radius b, the cylinder that rolls rotate about its own axis in such way that it does not skid/slip. Now, the thing that is making myself confused is the constraint...
  16. mfb

    I New cosmological neutrino mass constraint: sum<0.09 eV at 95% CL

    arXiv: On the most constraining cosmological neutrino mass bounds From neutrino mixing we know that an inverted order (two "heavy" neutrinos, one light neutrino) needs a sum of masses of at least ~0.09 eV, while the normal order (two light, one "heavy") can have a sum as low as ~0.05 eV. The...
  17. A

    Analytical Mechanics: Regularity Conditions on Constraint Surface

    Hi, In my course in analytical mechanics, it is said that for a system of n particles subjected to r constraint equations, it is necessary to impose regularity conditions on the constraint surface defined by G = 0 where G is a function of the position of the position of the particles and time...
  18. J

    A An additional constraint to the ZFC axioms?

    The ZFC axioms are statements combining "atomic formulas" such as "p ∈ A" and "A = B", using AND, OR, imply, NOT, for all and exists. But (it seems to me, at least) there is the implicit assumption that the "atomic formulas", "p ∈ A" and "A = B", are considered to be propositions, i.e. they are...
  19. nish95

    About the constraint equations of a pulley

    See the solved example as shown in the image. I don't understand how can we write S(A)=2S(B) since integrating V(A)=2V(B) will give us an extra unknown constant and the work done by friction will depend on it. I found the relation 2S(B) + S(A) = const. (somebody confirm if this is right?) so...
  20. polytheneman

    D'Alembert's principle and the work done by constraint forces

    From what I understand, constraint forces do no work because they are perpendicular to the allowed virtual displacements of the system. However, if you consider an unbalanced Atwood machine, in which both masses are accelerating in opposite directions, you'll find that the tension force of the...
  21. newbie12321

    B Wedge constraint relations

    There’s a rigid rod pushing on a wedge. Velocity of the rod is v, which is vertically downwards, and the wedge is sliding to the right as a result with a velocity u. There is zero friction on the surface of the wedge and the surface of the rod in contact with the wedge. According to wedge...
  22. Clara Chung

    Ideal gas problem after constraint removed

    Attempt: P_1 (initial pressure on the left section) P_2(initial pressure on the right section) T_f, P_f (final pressure for both sections) P_1 (V/3) = N/2 k (3T/2) P_2 (2V/3) = N/2 k (T/2) P_f V/2 = N/2 k T_f Resulting in 4 unknowns and 3 equations... Not enough to find T_f...
  23. Q

    Disc going along a parabola

    Homework Statement A disc of radius R rolls without slipping along the parabola y= ax2. Obtain the constrain equation Homework Equations Because there's no slipping, then: ##R d \theta = ds (1)## Where ##\theta ## is the angle between the line from the center of the disc to a fixed point...
  24. Philip Koeck

    I Applying a constraint in the calculus of variations

    I have an analytical function F of the discrete variables ni, which are natural numbers. I also know that the sum of all ni is constant and equal to N. N also appears explicitly in F, but F is not a function of N. F exists in a coordinate system given by the ni only. Should I carry out the...
  25. Shivang kohlii

    Constraint relation in a pulley spring system

    Homework Statement How to apply constraints in the system to get a relationship between the displacements of block of mass m and pulley of mass M.? Homework Equations ∑T.a= 0 The Attempt at a Solution Assuming tension in both strings to be T . -T × a1 ( for the block) + 2T × a2 ( for the...
  26. N

    Lagrangian Mechanics with one constraint

    Homework Statement I'm supposed to find the normal force acting on the box by the slab as a function of time. The problem is I don't know what the constraint is. I can't find the relation between r and theta that adds the two up to zero. Homework Equations Lagrangian equation. The Attempt...
  27. A

    Determining force of constraint

    Homework Statement Consider a particle moving over the curve ##z=a-bx^2## under the force of gravity. If the particle starts from rest at point ##(0,0)## (I'm guessing it means point ##(0,a)##), tell if the particle ever separates from the curve; if yes, find the point at which it does...
  28. S

    I Forces of Constraint: Solving Euler-Lagrange Equation

    Hello! I have this Lagrangian: $$L=\frac{1}{2}m\dot{r}^2(1+f'(r)^2)+\frac{1}{2}m\dot{\phi}^2r^2-mgf(r)+\lambda(\phi-\omega t)$$ This represents the motion of a point-like object of mass m along a curved wire with shape $$z=f(r)$$ The wire rotates with constant angular velocity around the z axis...
  29. Kushal Chakrabarti

    Constraint equations in mechanics

    1. The problem: Two blocks of mass m=5kg and M= 10kg are connected by a string passing over a pulley B. Another string connects pulley B to the floor and passes over pulley A. An upward force F is applied at the centre of pulley A. Both pulleys are massless. Find acceleration of the blocks if F...
  30. J

    Exact constraint in practice -- Pinned joint with 2 DOF

    I've come across this design issue several times, and don't know of any solution in industry. The basic assembly is this: A spherical bearing is fitted to a threaded rod end with a nut to clamp the ball to the rod end. The design intent is to allow angular displacement about the two axes...
  31. B

    Force of constraint in Lagrangian formation

    Homework Statement A mass m slides down a frictionless plane that is inclined at angle θ. Show, by considering the force of constraint in the Lagrangian formulation, that the normal force from the plane on the mass is the familiar mg cos(θ). Hint: Consider the Normal force to be the result of...
  32. fermipasta

    I How to model and resolve a static non-interpenetration constraint

    *Constraints (sorry the title got mangled) I want to model N spherical points pi in R3 with masses mi and bounding radii of ri for 1 <= i <= N. So I can write (N2-N)/2 inequality constraints: Ci,j : ||pi - pj|| - ri - rj >= 0 for unique pairs of i,j. Looking at the same problem for three...
  33. Pushoam

    Deciding holonomic constraint by drawing a picture

    Homework Statement Homework EquationsThe Attempt at a Solution I have not understood the question. So, could anyone please put some more light upon the question?
  34. Pushoam

    Deciding a holonomic constraint

    Homework Statement Homework EquationsThe Attempt at a Solution The smallest distance between the bead's surface and the wire's surface is always constant and it can be expressed as an equation of coordinates. So, this is a holonomic constraint. Is this correct?
  35. C

    Constraint of Two blocks on an inclined plane

    Hello, I have an issue regarding a constraint related to an angle: Suppose I have masses 'A' and 'B' on an inclined plane ( of mass 'C') attached by a pulley. I place my origin as shown and I want to find a constraint relating angle β. so, I saw my classmate writing as follows to find...
  36. Bayoudh101

    B The number of possible combinations with a constraint

    Hello , i was doing one of Euler project programming problems the other day , and i came across this one . i tried everything i know about probability , i tried combinations and everything , and i just couldn't get something logically fit to solve this . i tried to ignore this but i just...
  37. A

    I Physical interpretation of a Hamiltonian with a constraint

    Dear physics forums, What is the physical interpretation of imposing the following constrain on a Hamiltonian: Tr(\hat H^2)=2\omega ^2 where \omega is a given constant. I am not very familiar with why is the trace of the hamiltonian there. Thanks in advance, Alex
  38. ohwilleke

    I Muon g-2 as a constraint on new physics

    I. Background The magnetic moment of the muon, g, is predicted by the Standard Model, to be equal to 2 and a bit more, with the quantity that we look at being g-2. We have both experimental measurements and theoretical predictions that are close to each other to many significant digits, but...
  39. Auto-Didact

    A Falsifications and constraints due to GW measurements

    This thread is to serve as - a collection of theories that have been falsified by and/or have had new constrained placed on them by the ongoing gravitational wave measurements. - a place to discuss the further constraining/falsifying of still existing models using GW data. I'll start by posting...
  40. C

    A Trying to understand constraint equation from paper by Brink

    I am trying to fully understand the spectrum structure in the paper "A LAGRANGIAN FORMULATION OF THE CLASSICAL AND QUANTUM DYNAMICS OF SPINNING PARTICLES " by Brink, Vecchia and Howe. (I attached the file) I am having a problem with equation (4.13). It writes p \cdot b|\psi_{phys}\rangle=0 but...
  41. J

    A Do the equations of motion simply tell us which degrees of freedom apply?

    A massless spin 1 particle has 2 degrees of freedom. However, we usually describe it using four-vectors, which have four components. Hence, somehow we must get rid of the superfluous degrees of freedom. This job is done by the Maxwell equations. To quote from Gilmore's "Lie Groups, Physics, and...
  42. FallenApple

    Optimization Problem with a Constraint

    Homework Statement This is a leetcode question. You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will...
  43. danielhep

    Optimization w/ Constraint Question (Multivariable Calculus)

    Homework Statement Find any maxima/minima on f(x,y) = x2+2y2 on the unit circle, centered at the origin. Homework Equations grad f = λgrad g constraint: 1=x2+y2 The Attempt at a Solution grad f = 2xi+4yj grad g = 2xi+2yj 2x=λ2x 2y=λ4y How do I solve this? I don't see any way to get numbers...
  44. D

    Using momentum conservation as holonomic constraint

    < Mentor Note -- thread moved to HH from the technical physics forums, so no HH Template is shown > My question is from an exam in analytic mechanics. The question was about an object sliding on inclined plane, the plane's angle is constant, and the plane is free to move along X axis. No...
  45. M

    MHB Minimum of function under constraint

    Hey! :o We want to minimize the function $g(x_1, x_2)=2x_1+ x_2$ under the constraint $f(x_1, x_2)=x_1\cdot x_2=18$. \begin{equation*}x_1\cdot x_2=18 \Rightarrow x_1=\frac{18}{x_2}\end{equation*} \begin{equation*}\tilde{g}(x_2)=g\left (\frac{18}{x_2}, x_2\right )=2\cdot \frac{18}{x_2}+ x_2=...
  46. Urs Schreiber

    Insights 11d Gravity From Just the Torsion Constraint - Comments

    Urs Schreiber submitted a new PF Insights post 11d Gravity From Just the Torsion Constraint Continue reading the Original PF Insights Post.
  47. Q

    A Is this constraint nonholonomic or not?

    I really want to know whether this equation is nonholonomic or not. (As far as I know, Nonholonomic constraint has a term of velocity and do non-integrable. But this formula does not dependent on a path, because it is a total differential form.)
  48. Sergei65

    A Momentum Constraint in GR: ADM Formalism

    Momentum constraint in GR in ADM formalism is written in the form $$\mathcal M_i=\gamma_{ij}D_k\pi^{kj},~~~~~~~~~~(1a)$$ or equivalently $$\mathcal M_i=D_k\pi^{k}_i,~~~~~~~~~~(1b)$$ where ##\pi^{ij}=-\gamma^{1/2}\left(K^{ij}-\gamma^{ij}K\right)~##, ##K=\gamma^{ij}K_{ij}~##, ##\gamma=\det...