|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.combean.graph.alg.AbstractGraphAlg net.sourceforge.combean.graph.alg.flow.MulticommodityMinCostFlowByLPAlg
public class MulticommodityMinCostFlowByLPAlg
An implementation of a multicommodity min-cost flow algorithm using an LP solver.
Constructor Summary | |
---|---|
MulticommodityMinCostFlowByLPAlg()
constructor |
Method Summary | |
---|---|
void |
focusOnCommodity(int numCommodity)
All subsequent calls for a single commodity (e.g. setting the edge weight, the inflow or the individual capacitiy) refer to the given commodity. |
FixedDoubleEdgeMap |
getFlowMap()
Return the calculated flow. |
double |
getTotalCost()
Calculate the total cost of the flow. |
boolean |
isFeasible()
Check if a feasible flow exists. |
void |
run()
Execute the algorithm. |
void |
setCommonEdgeCapacityMap(FixedDoubleEdgeMap edgeCapacities)
Set the edge capacities for the sum of the flows. |
void |
setEdgeCapacityMap(FixedDoubleEdgeMap edgeCapacities)
Set the edge capacities. |
void |
setEdgeWeightsMap(FixedDoubleEdgeMap edgeWeights)
Set the cost of one unit of flow for each edge. |
void |
setInflowMap(FixedDoubleNodeMap inflowMap)
Set the inflow at each node in the graph. |
void |
setLpModelLoader(LPModelSolver lpModelSolver)
|
void |
setLpSolver(LPSolver lpSolver)
|
void |
setNumCommodities(int numCommodities)
Define the number of commodities. |
Methods inherited from class net.sourceforge.combean.graph.alg.AbstractGraphAlg |
---|
getGraph, setGraph |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.combean.interfaces.graph.alg.GraphAlgorithm |
---|
getGraph, setGraph |
Constructor Detail |
---|
public MulticommodityMinCostFlowByLPAlg()
Method Detail |
---|
public final void setLpModelLoader(LPModelSolver lpModelSolver)
lpModelSolver
- The lpModelSolver to set.public final void setLpSolver(LPSolver lpSolver)
lpSolver
- The lpSolver to set.public void setEdgeWeightsMap(FixedDoubleEdgeMap edgeWeights)
MinCostFlowAlg
setEdgeWeightsMap
in interface MinCostFlowAlg
edgeWeights
- a map containing the cost of each edge in the graphpublic void setInflowMap(FixedDoubleNodeMap inflowMap)
FeasibleFlowAlg
setInflowMap
in interface FeasibleFlowAlg
inflowMap
- the inflow at each node.public void setEdgeCapacityMap(FixedDoubleEdgeMap edgeCapacities)
AbstractFlowAlg
setEdgeCapacityMap
in interface AbstractFlowAlg
edgeCapacities
- a map containing the edge capacities.public void run()
GraphAlgorithm
run
in interface GraphAlgorithm
public boolean isFeasible()
FeasibleFlowAlg
isFeasible
in interface FeasibleFlowAlg
public double getTotalCost()
MinCostFlowAlg
getTotalCost
in interface MinCostFlowAlg
public FixedDoubleEdgeMap getFlowMap()
AbstractFlowAlg
getFlowMap
in interface AbstractFlowAlg
public void focusOnCommodity(int numCommodity)
MulticommodityCapable
focusOnCommodity
in interface MulticommodityCapable
numCommodity
- the commodity to which all subsequent calls
shall refer.public void setCommonEdgeCapacityMap(FixedDoubleEdgeMap edgeCapacities)
MulticommodityCapable
setCommonEdgeCapacityMap
in interface MulticommodityCapable
edgeCapacities
- a map containing the edge capacities.public void setNumCommodities(int numCommodities)
MulticommodityCapable
setNumCommodities
in interface MulticommodityCapable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |