Class for creating and modifying directed graphs with edge capacities and finding directed minimum cuts between given vertices. More...
#include <min_cut.hpp>
Public Types | |
using | Edge = Traits::edge_descriptor |
using | Vertex = Traits::vertex_descriptor |
Public Member Functions | |
min_cut_finder () | |
Constructor. | |
void | init (int vertices_num) |
Vertex | add_vertex_to_graph () |
std::pair< Edge, Edge > | add_edge_to_graph (Vertex src, Vertex trg, double cap, double rev_cap=0.) |
double | find_min_cut (Vertex src, Vertex trg) |
bool | is_in_source_set (Vertex v) const |
int | source_set_size () const |
std::pair< Vertex, Vertex > | get_last_cut () const |
double | get_capacity (Edge e) const |
void | set_capacity (Edge e, double cap) |
void | set_capacity (Vertex src, Vertex trg, double cap) |
Class for creating and modifying directed graphs with edge capacities and finding directed minimum cuts between given vertices.
Definition at line 31 of file min_cut.hpp.
|
inline |
Adds an edge to the graph.
src | source vertex of for the added edge |
trg | target vertex of for the added edge |
cap | capacity of the added edge |
rev_cap | capacity of the reverse edge |
Definition at line 70 of file min_cut.hpp.
|
inline |
Adds a new vertex to the graph.
Definition at line 58 of file min_cut.hpp.
|
inline |
Finds the min cut between src
and trg
.
src | source vertex (belongs to the cut set) |
trg | target vertex (does not belong to the cut set) |
Definition at line 95 of file min_cut.hpp.
|
inline |
Returns the capacity of a given edge.
Definition at line 133 of file min_cut.hpp.
|
inline |
Returns the pair of vertices defining the last checked cut.
Definition at line 128 of file min_cut.hpp.
|
inline |
(Re)Initializes the graph.
Definition at line 46 of file min_cut.hpp.
|
inline |
Checks if the given vertex belongs to the source side of the last checked cut.
Definition at line 109 of file min_cut.hpp.
|
inline |
Sets the capacity of a given edge.
Definition at line 138 of file min_cut.hpp.
|
inline |
Sets the capacity of a given edge.
Definition at line 145 of file min_cut.hpp.
|
inline |
Returns the number of vertices in the source size of the last checked cut.
Definition at line 117 of file min_cut.hpp.