JaCoP.constraints.netflow
Class NetworkBuilder

java.lang.Object
  extended by JaCoP.constraints.netflow.NetworkBuilder

public class NetworkBuilder
extends java.lang.Object

A builder class for the network flow constraints. Models should use or inherit from this class to build a network.

Version:
3.1
Author:
Robin Steiger and Radoslaw Szymanek

Field Summary
 java.util.List<Arc> arcList
           
 IntVar costVariable
           
 java.util.List<VarHandler> handlerList
           
 java.util.List<Node> nodeList
           
 
Constructor Summary
NetworkBuilder()
           
NetworkBuilder(IntVar costVariable)
           
 
Method Summary
 Arc addArc(Node from, Node to)
           
 Arc addArc(Node from, Node to, int weight)
           
 Arc addArc(Node from, Node to, int weight, int capacity)
           
 Arc addArc(Node from, Node to, int weight, int lowerCapacity, int upperCapacity)
           
 Arc addArc(Node from, Node to, int weight, IntVar xVar)
           
 Arc addArc(Node from, Node to, IntVar wVar, int lowerCapacity, int upperCapacity)
           
 Arc addArc(Node from, Node to, IntVar wVar, IntVar xVar)
           
 Node addNode()
           
 Node addNode(int balance)
           
 Node addNode(java.lang.String name)
           
 Node addNode(java.lang.String name, int balance)
           
 NetworkFlow build()
           
 java.util.ArrayList<IntVar> listVariables()
           
 java.util.ArrayList<Constraint> primitiveDecomposition(Store store)
          Generally speaking, especially in case of multiple arcs between two nodes and structure constraints imposed on arcs makes it hard to decompose network flow constraint into primitive ones.
 void setCostVariable(IntVar costVariable)
           
 Node[][] valueGraph(IntVar[] vars, IntDomain[] domains)
          Returns two arrays containing the nodes for each variable and the nodes for each domain, respectively.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

costVariable

public IntVar costVariable

nodeList

public final java.util.List<Node> nodeList

arcList

public final java.util.List<Arc> arcList

handlerList

public final java.util.List<VarHandler> handlerList
Constructor Detail

NetworkBuilder

public NetworkBuilder()

NetworkBuilder

public NetworkBuilder(IntVar costVariable)
Method Detail

setCostVariable

public void setCostVariable(IntVar costVariable)

addNode

public Node addNode()

addNode

public Node addNode(int balance)

addNode

public Node addNode(java.lang.String name)

addNode

public Node addNode(java.lang.String name,
                    int balance)

addArc

public Arc addArc(Node from,
                  Node to,
                  IntVar wVar,
                  IntVar xVar)

addArc

public Arc addArc(Node from,
                  Node to,
                  int weight,
                  IntVar xVar)

addArc

public Arc addArc(Node from,
                  Node to,
                  IntVar wVar,
                  int lowerCapacity,
                  int upperCapacity)

addArc

public Arc addArc(Node from,
                  Node to,
                  int weight,
                  int lowerCapacity,
                  int upperCapacity)

addArc

public Arc addArc(Node from,
                  Node to,
                  int weight,
                  int capacity)

addArc

public Arc addArc(Node from,
                  Node to,
                  int weight)

addArc

public Arc addArc(Node from,
                  Node to)

valueGraph

public Node[][] valueGraph(IntVar[] vars,
                           IntDomain[] domains)
Returns two arrays containing the nodes for each variable and the nodes for each domain, respectively.


listVariables

public java.util.ArrayList<IntVar> listVariables()

build

public NetworkFlow build()

primitiveDecomposition

public java.util.ArrayList<Constraint> primitiveDecomposition(Store store)
Generally speaking, especially in case of multiple arcs between two nodes and structure constraints imposed on arcs makes it hard to decompose network flow constraint into primitive ones. Since, the decomposition introduces new variables and removal of artificial solutions is not practically achievable in all cases it is possible that decomposition will have more solutions due to the fact that decomposition may use more expensive arcs to transfer the flow.

Parameters:
store -