nxpp
Header-only graph utilities on top of Boost Graph Library
Loading...
Searching...
No Matches
nxpp::MinimumCutResult< NodeID > Struct Template Reference

Result of a minimum-cut computation. More...

#include <flow.hpp>

Collaboration diagram for nxpp::MinimumCutResult< NodeID >:

Public Attributes

long value = 0
 
std::vector< NodeID > reachable
 
std::vector< NodeID > non_reachable
 
std::vector< std::pair< NodeID, NodeID > > cut_edges
 
std::vector< std::size_t > cut_edge_ids
 

Detailed Description

template<typename NodeID>
struct nxpp::MinimumCutResult< NodeID >

Result of a minimum-cut computation.

The reachable and non-reachable partitions correspond to the residual graph after the max-flow phase. The cut_edges field is the endpoint-keyed convenience view, while cut_edge_ids exposes the precise wrapper-tracked edge IDs that cross the cut.

Example:

g.add_edge("s", "a", 1.0, {{"capacity", 3L}});
g.add_edge("a", "t", 1.0, {{"capacity", 3L}});
auto cut = g.minimum_cut("s", "t");
auto cut_value = cut.value;
auto left_side = cut.reachable;
Graph wrapper around Boost Graph Library with Python-inspired helpers.
Definition graph.hpp:272
auto minimum_cut(const NodeID &source_id, const NodeID &target_id, const std::string &capacity_attr="capacity") const
Computes a minimum cut between source and target using the named capacity attribute.
Definition flow.hpp:482

The documentation for this struct was generated from the following file: