|
| template<typename Node , typename WeightFunc > |
| auto | detail::build_dual (const std::vector< std::vector< Node > > &faces, WeightFunc weight) -> std::vector< std::vector< DualEdge< Node > > > |
| |
| template<typename Node > |
| auto | detail::dijkstra (const std::vector< std::vector< DualEdge< Node > > > &dual, int src) -> std::pair< std::vector< int >, std::vector< int > > |
| |
| auto | detail::reconstruct_path (const std::vector< int > &prev, int src, int dst) -> std::vector< int > |
| |
| template<typename Node > |
| auto | detail::greedy_mwpm (const std::vector< int > &odd_faces, const std::vector< std::vector< int > > &dist) -> std::vector< std::pair< int, int > > |
| |
| template<typename Node > |
| auto | detail::exact_mwpm (const std::vector< int > &odd_faces, const std::vector< std::vector< int > > &dist) -> std::vector< std::pair< int, int > > |
| |
| template<typename Node > |
| auto | detail::min_weight_perfect_matching (const std::vector< int > &odd_faces, const std::vector< std::vector< int > > &dist) -> std::vector< std::pair< int, int > > |
| |
| template<typename Graph > |
| auto | detail::biconnected_components (const Graph &G) -> std::vector< py::set< typename Graph::node_t > > |
| | Decompose a graph into its biconnected components (blocks).
|
| |
| template<typename Graph , typename WeightFunc > |
| auto | detail::solve_hadlock_component (const Graph &G, WeightFunc weight, const std::vector< std::vector< typename Graph::node_t > > &faces) -> py::set< std::pair< typename Graph::node_t, typename Graph::node_t > > |
| | Solve MAX-CUT for a single planar biconnected component.
|
| |
| template<typename Graph , typename WeightFunc > |
| auto | solve_hadlock_max_cut (const Graph &G, WeightFunc weight, const std::vector< std::vector< typename Graph::node_t > > &faces) -> py::set< std::pair< typename Graph::node_t, typename Graph::node_t > > |
| | Solve MAX-CUT for a planar graph using Hadlock's algorithm.
|
| |
| template<typename Graph , typename WeightFunc > |
| auto | solve_hadlock_max_cut (const Graph &G, WeightFunc weight, const std::vector< std::vector< std::vector< typename Graph::node_t > > > &component_faces) -> py::set< std::pair< typename Graph::node_t, typename Graph::node_t > > |
| | Solve MAX-CUT using biconnected component decomposition for speed.
|
| |
| template<typename Graph , typename WeightFunc > |
| auto | validate_max_cut (const Graph &G, const py::set< std::pair< typename Graph::node_t, typename Graph::node_t > > &cut_edges, WeightFunc weight) -> std::pair< bool, int > |
| |
| template<typename Graph > |
| auto | validate_max_cut (const Graph &G, const py::set< std::pair< typename Graph::node_t, typename Graph::node_t > > &cut_edges) -> std::pair< bool, int > |
| |
Hadlock's algorithm: planar MAX-CUT -> minimum weight perfect matching on dual.
The algorithm is accelerated by biconnected component decomposition: MAX-CUT is additive over biconnected components because edges in different blocks share only articulation points and cannot form cycles together. Processing each block independently dramatically reduces the size of the dual-graph shortest-path and MWPM subproblems.
Reference: Hadlock, F. O. (1975). "Finding a Maximum Cut of a Planar Graph in
Polynomial Time." SIAM Journal on Computing, 4(3), 221-225.