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

Result of a maximum-flow computation. More...

#include <flow.hpp>

Collaboration diagram for nxpp::MaximumFlowResult< NodeID >:

Public Attributes

long value = 0
 
std::map< std::pair< NodeID, NodeID >, long > flow
 
std::map< std::size_t, long > edge_flows_by_id
 

Detailed Description

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

Result of a maximum-flow computation.

The value field stores the total flow. The flow member is the endpoint-keyed convenience view, while edge_flows_by_id keeps the precise flow assignment for each wrapper-tracked edge ID. In multigraphs, use edge_flows_by_id when one concrete parallel edge matters.

Example:

g.add_edge("s", "a", 1.0, {{"capacity", 3L}});
g.add_edge("a", "t", 1.0, {{"capacity", 3L}});
auto result = g.maximum_flow("s", "t");
auto total = result.value;
auto endpoint_flow = result.flow.at({"s", "a"});
Graph wrapper around Boost Graph Library with Python-inspired helpers.
Definition graph.hpp:272
auto maximum_flow(const NodeID &source_id, const NodeID &target_id, const std::string &capacity_attr="capacity") const
Computes the maximum flow value and edge assignments using the named capacity attribute.
Definition flow.hpp:479

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