Understanding the Theorem for Feasible Solutions of Difference Constraints

  • MHB
  • Thread starter evinda
  • Start date
In summary, the conversation discusses the construction of a graph for a system of difference constraints, where each vertex represents an unknown variable and edges represent constraints between variables. The weight of each edge is determined by the corresponding constraint. The conversation then goes on to explain a theorem for finding a feasible solution for the system, based on the shortest path from a designated vertex. The theorem states that if the graph does not contain negative weight cycles, then the solution can be found by setting the variables to the shortest path distances from the designated vertex. The conversation also discusses finding the shortest path based on common sense and verifying the solution by replacing the variables in the constraints.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Wave)

We construct the graph of a system of difference constraints like that:
Each vertex $v_i$ corresponds to one of the unknown variables.
Between the vertices $v_i$ and $v_j$ there is an edge iff $x_j-x_i \leq b_k$.
The weight of the edge $(v_i,v_j)$ is $b_k$.
At the graph of a system of difference constraints,we add an additional vertex $v_0$ and the edges $(v_0,v_1), (v_0,v_2), \dots, (v_0,v_n)$ with weight $0$.

Could you explain me the following theorem? (Thinking)

Let $G$ the graph,that corresponds to the problem $Ax \leq b$.If $G$ does not contain negative weight cycles,then a feasible solution of $Ax \leq b$ is this:
$$x=(\delta(v_0,v_1),\delta(v_0,v_2), \dots, \delta(v_0,v_n))$$
If $G$ contains negative weight cycles ,then $Ax \leq b$ has no feasible solution.
 
Physics news on Phys.org
  • #2
evinda said:
Hello! (Wave)

We construct the graph of a system of difference constraints like that:
Each vertex $v_i$ corresponds to one of the unknown variables.
Between the vertices $v_i$ and $v_j$ there is an edge iff $x_j-x_i \leq b_k$.
The weight of the edge $(v_i,v_j)$ is $b_k$.
At the graph of a system of difference constraints,we add an additional vertex $v_0$ and the edges $(v_0,v_1), (v_0,v_2), \dots, (v_0,v_n)$ with weight $0$.

Could you explain me the following theorem? (Thinking)

Let $G$ the graph,that corresponds to the problem $Ax \leq b$.If $G$ does not contain negative weight cycles,then a feasible solution of $Ax \leq b$ is this:
$$x=(\delta(v_0,v_1),\delta(v_0,v_2), \dots, \delta(v_0,v_n))$$
If $G$ contains negative weight cycles ,then $Ax \leq b$ has no feasible solution.

Hi! (Smile)

Can you give us an example with, say, 2 variables? (Wondering)
 
  • #3
I like Serena said:
Hi! (Smile)

Can you give us an example with, say, 2 variables? (Wondering)

This is an example of a system of difference constraints:

$$x_1-x_2 \leq 0$$
$$x_1-x_5 \leq -1$$
$$x_2-x_5 \leq 1$$
$$x_3-x_1 \leq 5$$
$$x_4-x_1 \leq 4$$
$$x_4-x_3 \leq -1$$
$$x_5-x_3 \leq -3$$
$$x_5-x_4 \leq -3$$

The graph of this system of difference constraints is the following:

View attachment 3139
 

Attachments

  • diff.png
    diff.png
    10.2 KB · Views: 59
  • #4
Okay!
So what would the feasible solution be? (Wondering)
 
  • #5
I like Serena said:
Okay!
So what would the feasible solution be? (Wondering)

So...do I have to apply now the algorithm of Bellman-Ford,to find $d[v], \forall v \in V$ and then the feasible solution will be:

$$x=(d[v_1],d[v_2], \dots , d[v_5])$$

? (Thinking)
 
  • #6
evinda said:
So...do I have to apply now the algorithm of Bellman-Ford,to find $d[v], \forall v \in V$ and then the feasible solution will be:

$$x=(d[v_1],d[v_2], \dots , d[v_5])$$

? (Thinking)

Yes.
Or else you could do it based on common sense, which should boil down to the same thing. (Wink)
 
  • #7
I like Serena said:
Yes.
Or else you could do it based on common sense, which should boil down to the same thing. (Wink)

How could I do it based on common sense? (Thinking)
 
  • #8
evinda said:
How could I do it based on common sense? (Thinking)

Try to find the shortest path from $v_0$ to $v_1$.
The direct path takes $0$.
Via $v_5$ it takes $-1$, which is better.

Can you find a better path yet? (Wondering)Btw, you don't need a perfect solution if you only want to understand the theorem.
Just a set of fairly low-cost paths will do to see how it works.
 
  • #9
I like Serena said:
Try to find the shortest path from $v_0$ to $v_1$.
The direct path takes $0$.
Via $v_5$ it takes $-1$, which is better.

Can you find a better path yet? (Wondering)

I found a better path: $v_0 \to v_4 \to v_5 \to v_1$ , which weight is $-4$.

I like Serena said:
Btw, you don't need a perfect solution if you only want to understand the theorem.
Just a set of fairly low-cost paths will do to see how it works.

I just wanted to understand the theorem, but I haven't understood yet, why $x=(\delta(v_0,v_1), \delta(v_0,v_2), \dots , \delta(v_0,v_n))$ is a solution of $Ax \leq b$.. (Sweating) Could you explain it further to me? (Thinking)
 
  • #10
evinda said:
I found a better path: $v_0 \to v_4 \to v_5 \to v_1$ , which weight is $-4$.

There you go! (Smile)
I just wanted to understand the theorem, but I haven't understood yet, why $x=(\delta(v_0,v_1), \delta(v_0,v_2), \dots , \delta(v_0,v_n))$ is a solution of $Ax \leq b$.. (Sweating) Could you explain it further to me? (Thinking)

We have just found that $\delta(v_0,v_1)=-4$.
That means that we are supposed to have a feasible solution with $x_1=-4$.
Can you also find the (or at least reasonable) values for the other variables?

Do they form what is called a feasible solution? (Wondering)
 
  • #11
I like Serena said:
We have just found that $\delta(v_0,v_1)=-4$.
That means that we are supposed to have a feasible solution with $x_1=-4$.
Can you also find the (or at least reasonable) values for the other variables?

Do they form what is called a feasible solution? (Wondering)

I found the following shortest paths:

$v_0 \to v_3 \to v_4 \to v_5 \to v_2$, which weight is $-3$

$v_0 \to v_3$, which weight is $0$

$v_0 \to v_3 \to v_4$, which weight is $-1$

$v_0 \to v_3 \to v_4 \to v_5$, which weight is $-4$

Am I right? (Thinking)

So.. according to the theorem, a feasible solution is: $(-4,-3,0,-1,-4)$.. Can I just verify it, replacing $x_i, i \in \{ 1, \dots, 5 \}$ at the inequalities? (Thinking)
 
  • #12
evinda said:
I found the following shortest paths:

$v_0 \to v_3 \to v_4 \to v_5 \to v_2$, which weight is $-3$

$v_0 \to v_3$, which weight is $0$

$v_0 \to v_3 \to v_4$, which weight is $-1$

$v_0 \to v_3 \to v_4 \to v_5$, which weight is $-4$

Am I right? (Thinking)

I think so. (Nod)

So.. according to the theorem, a feasible solution is: $(-4,-3,0,-1,-4)$.. Can I just verify it, replacing $x_i, i \in \{ 1, \dots, 5 \}$ at the inequalities? (Thinking)

Yes. That is what it means.
Does it check out? (Wondering)
 
  • #13
I like Serena said:
Yes. That is what it means.
Does it check out? (Wondering)

Isn't it like that?

$$x_1=-4$$

$$x_2=-3$$

$$x_3=0$$

$$x_4=-1$$

$$x_5=-4$$

$$x_1-x_2=-1 \leq 0 $$

$$x_1-x_5=0 \geq -1$$

$$x_2-x_5=1 \leq 1$$

$$x_3-x_1=4 \leq 5$$

$$x_4-x_1=3 \leq 4$$

$$x_4-x_3=-1 \leq -1$$

$$x_5-x_3=-4 \leq -3$$

$$x_5-x_4=-3 \leq -3$$

The inequality $x_1-x_5 \leq -1$ doesn't hold... (Sweating) Have I done something wrong? (Thinking)
 
  • #14
evinda said:
Isn't it like that?

The inequality $x_1-x_5 \leq -1$ doesn't hold... (Sweating) Have I done something wrong? (Thinking)

Looks that way.
Can you find a better path for $x_1$ then? (Wondering)
 
  • #15
I like Serena said:
Looks that way.
Can you find a better path for $x_1$ then? (Wondering)

I found a better path for $x_1$: $v_0 \to v_3 \to v_4 \to v_5 \to v_1$, which weight is equal to $-5$.

So, $x_1=-5$

Now:

$$x_1-x_2=-8 \leq 0$$

$$x_1-x_5=-1 \leq -1$$

$$x_3-x_1=5 \leq 5$$

$$x_4-x_1=4 \leq 4$$

Right? (Thinking)
 
  • #16
evinda said:
I found a better path for $x_1$: $v_0 \to v_3 \to v_4 \to v_5 \to v_1$, which weight is equal to $-5$.

So, $x_1=-5$

Right? (Thinking)

Right! (Yes)

I guess you understand the theorem now. (Clapping)
 

Related to Understanding the Theorem for Feasible Solutions of Difference Constraints

What is a feasible solution in the context of Ax<=b?

A feasible solution refers to a set of values or variables that satisfy the given linear inequalities Ax<=b. In other words, it is a set of values that, when plugged into the equation, make the statement true.

How is a feasible solution different from an optimal solution?

A feasible solution may not necessarily be the best or most efficient solution, but it satisfies all the given constraints. An optimal solution, on the other hand, is the best possible solution that maximizes or minimizes the objective function while still satisfying the constraints.

Can there be multiple feasible solutions for a given Ax<=b?

Yes, there can be multiple feasible solutions for a given set of linear inequalities Ax<=b. This is because there can be an infinite number of combinations of values that satisfy the constraints.

How do you determine if a given solution is feasible?

To determine if a given solution is feasible, you can plug in the values into the equations and check if they satisfy all the constraints. If all the inequalities hold true, then the solution is feasible.

What is the importance of finding a feasible solution in linear programming?

Finding a feasible solution is the first step in solving a linear programming problem. It helps to identify the feasible region, which is the set of all feasible solutions. This region is used to find the optimal solution that maximizes or minimizes the objective function.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
2K
Replies
1
Views
2K
Replies
1
Views
784
Replies
11
Views
1K
  • Differential Equations
Replies
1
Views
822
  • Differential Equations
Replies
8
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Programming and Computer Science
Replies
6
Views
2K
Back
Top