0

This is an exercise from CLRS 24.4-12,(not homework, I just try to solve the all the exercise in CLRS)

Give an efficient algorithm to solve a system Ax ≤ b of difference constraints when all of the elements of b are real-valued and a specified subset of some, but not necessarily all, of the unknowns xi must be integers.

If all the xi are integers, we can let b = floor(b) and using Bellman-Ford algorithm finding the shortest path to solve the problem in a constraint graph, but how about some of xi are integers and some not? It is similar to integer programming problem, but integer programming is NP-hard, This question has less constraints, is there an more efficient algorithm?

Bart
  • 19,692
  • 7
  • 68
  • 77
meteorgan
  • 246
  • 3
  • 9

3 Answers3

1

First find the element with minimum absolute value in vector b , multiply it by C to make all of the values in vector of b integer (e.g. if the minimum absolute value is 3.102, we can multiply vector b by 1000), then solve it by bellman-ford algorithm , and finally divide it by C !

Arian
  • 7,397
  • 21
  • 89
  • 177
0

You have similar things in linear optimization - the only difference is that you have no minimum or maximum requirement. Maybe you can adapt some of the methods. Starting from a real-valued solution, there is the Gomory algorithm adding additional constraints to force the integer xi to become integer, and there are Branch-and-Bound algorithms, trying to exclude big parts of the search space as soon as possible.

Landei
  • 54,104
  • 13
  • 100
  • 195
  • I guess my solution of -12 could be viewed as adding Gomory cutting planes, but I don't think that's an especially productive way to think about it. Branch and bound is not relevant to this problem. – oldboy Apr 11 '12 at 13:08
  • If you solve it as a linear programming, as I mentioned , It's NP-hard. I want to know if exists an efficient solution. – meteorgan Apr 11 '12 at 13:31
0

Well. Dude, this is an exercise of Introduction to Algorithm. My own way is to adapt Bellman-Ford algorithm, which is to basically construct a directed weighted graph based on the inequalities and then when relaxing the edges, only allow integers to be the key value of the node. I think it's gonna work.