[all packages]
[package ]
[class hierarchy]
[index]
java.lang.Object | +----Solution
public class Solution
A class which solves a set of constraints.
The algorithm is a simple 2-pass dynamic program.
In the first pass, we minimize all of the variables, and find the maximum horizontal and maximum vertical variables.
In the second pass, we maximize all of the variables, using the previously found maxima as upper bounds.
This gives two values for each variable: a minimum and a maximum. We just average the two to give a result.
This algorithm sometimes produces sub-optimal results (sometimes it can result in pretty extreme diagonals) but most times it produces reasonable graphs. It runs in linear time in the number of variables.
public Solution(Constraints C);
C
public Constraints C;
public int hMax;
public int vMax;
minimal
public int minimal(int x);
public int maximal(int x);
public int value(int x);
[all packages]
[package ]
[class hierarchy]
[index]