Min-st-cut algorithm, that calculates the cut via maxflow.
More...
#include <ogdf/graphalg/MinSTCutMaxFlow.h>
|
| | MinSTCutMaxFlow (bool treatAsUndirected=true, MaxFlowModule< TCost > *mfModule=new MaxFlowGoldbergTarjan< TCost >(), bool primaryCut=true, bool calculateOtherCut=true, EpsilonTest *epsilonTest=new EpsilonTest()) |
| | Constructor. More...
|
| |
| virtual bool | call (const Graph &graph, const EdgeArray< TCost > &weight, node s, node t, List< edge > &edgeList, edge e_st=nullptr) override |
| | The actual algorithm call. More...
|
| |
| virtual bool | call (const Graph &graph, node s, node t, List< edge > &edgeList, edge e_st=nullptr) override |
| | The actual algorithm call. More...
|
| |
| void | call (const Graph &graph, const EdgeArray< TCost > &weights, const EdgeArray< TCost > &flow, const node source, const node target) |
| | Partitions the nodes to front- and backcut. More...
|
| |
| bool | frontCutIsComplementOfBackCut () const |
| | Returns whether the front cut is the complement of the backcut. More...
|
| |
| bool | isBackCutEdge (const edge e) const |
| | Returns whether this edge is entering the back cut. More...
|
| |
| bool | isFrontCutEdge (const edge e) const |
| | Returns whether this edge is leaving the front cut. More...
|
| |
| bool | isInBackCut (const node v) const |
| | Returns whether this node is part of the back cut. More...
|
| |
| bool | isInFrontCut (const node v) const |
| | Returns whether this node is part of the front cut. More...
|
| |
| bool | isOfType (const node v, cutType type) const |
| | Return whether this node is of the specified type. More...
|
| |
| void | setEpsilonTest (EpsilonTest *et) |
| | Assigns a new epsilon test. More...
|
| |
| | MinSTCutModule () |
| | default constructor (empty) More...
|
| |
| virtual | ~MinSTCutModule () |
| |
| virtual bool | direction (edge e) |
| | Returns the direction of e in the cut. More...
|
| |
template<typename TCost>
class ogdf::MinSTCutMaxFlow< TCost >
Min-st-cut algorithm, that calculates the cut via maxflow.
- Template Parameters
-
| TCost | The type in which the weight of the edges is given. |
Definition at line 46 of file MinSTCutMaxFlow.h.
◆ cutType
The three types of cuts.
| Enumerator |
|---|
| FRONT_CUT | node is in front cut
|
| BACK_CUT | node is in back cut
|
| NO_CUT | node is not part of any cut
|
Definition at line 99 of file MinSTCutMaxFlow.h.
◆ MinSTCutMaxFlow()
Constructor.
- Parameters
-
| treatAsUndirected | States whether or not |
| mfModule | The MaxFlowModule that is used to calculate a flow. The module will be deleted, when the lifetime of this object is over. |
| primaryCut | true if the algorithm should search for the mincut nearest to s, false if it should be near to t. |
| calculateOtherCut | if true, the other cut (primaryCut == false : front cut, primaryCut == true : back cut) should also be calculated. Setting this to false will speed up the algorithm a bit, but some functions might not work correctly or at all. |
| epsilonTest | The module used for epsilon tests. The module will be deleted, when the lifetime of this object is over. |
Definition at line 64 of file MinSTCutMaxFlow.h.
◆ call() [1/3]
template<typename TCost >
The actual algorithm call.
- Parameters
-
| graph | The graph on which the min-st-cut is to be calculated. |
| weight | Provides a weight for every edge. |
| s | The source node. |
| t | The target node. |
| edgeList | This list is filled with the edges which are part of the mincut. If the graph is st-planarly embedded, this list is correctly ordered along the cut. |
| e_st | An edge between s and t which is used to determine where the cut should start, nullptr elsewise. |
- Returns
- Indicates success.
Implements ogdf::MinSTCutModule< TCost >.
Definition at line 314 of file MinSTCutMaxFlow.h.
◆ call() [2/3]
The actual algorithm call.
- Parameters
-
| graph | The graph on which the min-st-cut is to be calculated. |
| s | The source node. |
| t | The target node. |
| edgeList | This list is filled with the edges which are part of the mincut. If the graph is st-planarly embedded, this list is correctly ordered along the cut. |
| e_st | An edge between s and t which is used to determine where the cut should start, nullptr elsewise. |
- Returns
- Indicates success.
Implements ogdf::MinSTCutModule< TCost >.
Definition at line 80 of file MinSTCutMaxFlow.h.
◆ call() [3/3]
template<typename TCost >
Partitions the nodes to front- and backcut.
- Parameters
-
| graph | The underlying graph |
| weights | The weights (aka capacity) of the edges |
| flow | The precomputed flow of each edge |
| source | The source of the min cut |
| target | the target (aka sink) of the minimum cut |
Definition at line 358 of file MinSTCutMaxFlow.h.
◆ computeCut()
Partitions the nodes to front and back cut.
- Parameters
-
| graph | The input graph |
| origEdge | Maps internal edges to edges of the the input graph. |
| origNode | Maps internal nodes to nodes from the input graph. |
| source | The source node. |
| target | The target node. |
| edgeList | A list in which the edges of the cut are stored in. |
Definition at line 247 of file MinSTCutMaxFlow.h.
◆ frontCutIsComplementOfBackCut()
Returns whether the front cut is the complement of the backcut.
i.e. there are no nodes not assigned to one of both cut types.
- Precondition
calculateOtherCut has to be set to true in the constructor
Definition at line 119 of file MinSTCutMaxFlow.h.
◆ isBackCutEdge()
Returns whether this edge is entering the back cut.
Definition at line 138 of file MinSTCutMaxFlow.h.
◆ isFrontCutEdge()
Returns whether this edge is leaving the front cut.
Definition at line 128 of file MinSTCutMaxFlow.h.
◆ isInBackCut()
Returns whether this node is part of the back cut.
Meaning it is located in the same set as the target.
- Parameters
-
Definition at line 161 of file MinSTCutMaxFlow.h.
◆ isInFrontCut()
Returns whether this node is part of the front cut.
Meaning it is located in the same set as the source.
Definition at line 149 of file MinSTCutMaxFlow.h.
◆ isOfType()
Return whether this node is of the specified type.
- Parameters
-
| v | the node to be tested |
| type | the cut type to test for (see MinSTCut::CutType) |
- Returns
- true if the node is contained in the specified cut
Definition at line 178 of file MinSTCutMaxFlow.h.
◆ markCut()
Mark the all nodes which are in the same cut partition as the startNode.
- Parameters
-
| startNode | Only works if this is either s or t. |
| frontCut | Should be set to true, iff startNode is s. |
| origNode | A function which maps the internal nodes to the nodes of the input graph. |
Definition at line 213 of file MinSTCutMaxFlow.h.
◆ setEpsilonTest()
◆ m_backCutCount
◆ m_calculateOtherCut
iff true, the other (near to s for primaryCut == false, near to t for primaryCut == true) cut should also be calculated.
Setting this to false will speed up the algorithm a bit, but all functions but call might not work correctly or at all.
Definition at line 195 of file MinSTCutMaxFlow.h.
◆ m_et
◆ m_flow
◆ m_frontCutCount
◆ m_mfModule
◆ m_nodeSet
◆ m_primaryCut
true if the algorithm should search for the mincut nearest to s, false if it should be near to t.
Definition at line 189 of file MinSTCutMaxFlow.h.
◆ m_totalCount
◆ m_treatAsUndirected
states whether or not edges are considered undirected while calculating the maxflow
Definition at line 187 of file MinSTCutMaxFlow.h.
◆ m_weight
The documentation for this class was generated from the following file: