|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for Bipartite. More...
#include <gtest/gtest.h>#include <tpl_bipartite.H>#include <tpl_graph.H>#include <tpl_maxflow.H>#include <random>#include <vector>Go to the source code of this file.
Typedefs | |
| using | Graph = List_Graph< Graph_Node< int >, Graph_Arc< Empty_Class > > |
Functions | |
| Graph | create_complete_bipartite (size_t m, size_t n) |
| Creates a complete bipartite graph K_{m,n} Left partition: nodes 0..m-1 Right partition: nodes m..m+n-1. | |
| Graph | create_path_graph (size_t n) |
| Creates a path graph with n nodes: 0–1–2–...–n-1 Path graphs are always bipartite. | |
| Graph | create_cycle_graph (size_t n) |
| Creates a cycle graph with n nodes: 0–1–2–...–n-1–0 Even cycles are bipartite, odd cycles are not. | |
| Graph | create_star_graph (size_t n) |
| Creates a star graph with center and n leaves Star graphs are always bipartite. | |
| Graph | create_triangle () |
| Creates a triangle (K_3) - the simplest non-bipartite graph. | |
| Graph | create_disconnected_bipartite () |
| Creates two disconnected components. | |
| bool | verify_bipartition (const Graph &g, const DynDlist< Graph::Node * > &l, const DynDlist< Graph::Node * > &r) |
| Verifies that a bipartition is valid: | |
| bool | verify_matching (const Graph &g, const DynDlist< Graph::Arc * > &matching) |
| Verifies that a matching is valid: | |
| TEST (Bipartite, EmptyGraphReturnsEmpty) | |
| TEST (Bipartite, SingleNode) | |
| TEST (Bipartite, TwoConnectedNodes) | |
| TEST (Bipartite, PathGraphEven) | |
| TEST (Bipartite, PathGraphOdd) | |
| TEST (Bipartite, StarGraph) | |
| TEST (Bipartite, CompleteBipartiteK22) | |
| TEST (Bipartite, CompleteBipartiteK33) | |
| TEST (Bipartite, CompleteBipartiteK25) | |
| TEST (Bipartite, EvenCycle) | |
| TEST (Bipartite, TriangleThrows) | |
| TEST (Bipartite, OddCycleThrows) | |
| TEST (Bipartite, LargeOddCycleThrows) | |
| TEST (Bipartite, CompleteGraphK3Throws) | |
| TEST (Bipartite, GraphWithOddCycleAttached) | |
| TEST (Bipartite, TwoDisconnectedNodes) | |
| TEST (Bipartite, DisconnectedBipartiteComponents) | |
| TEST (ComputeBipartiteClass, BasicUsage) | |
| TEST (ComputeBipartiteClass, ThrowsOnNonBipartite) | |
| TEST (MaximumMatching, EmptyGraphReturnsEmpty) | |
| TEST (MaximumMatching, SingleEdge) | |
| TEST (MaximumMatching, PathGraph4) | |
| TEST (MaximumMatching, PathGraph5) | |
| TEST (MaximumMatching, CompleteBipartiteK22) | |
| TEST (MaximumMatching, CompleteBipartiteK33) | |
| TEST (MaximumMatching, CompleteBipartiteK55) | |
| TEST (MaximumMatching, UnbalancedK25) | |
| TEST (MaximumMatching, UnbalancedK52) | |
| TEST (MaximumMatching, StarGraph) | |
| TEST (MaximumMatching, EvenCycle) | |
| TEST (MaximumMatching, ThrowsOnNonBipartite) | |
| TEST (MaximumMatchingClass, BasicUsage) | |
| TEST (MaximumMatchingClass, ThrowsOnNonBipartite) | |
| TEST (BipartiteStress, LargeBipartiteGraph) | |
| TEST (BipartiteStress, LargePathGraph) | |
| TEST (MaximumMatchingStress, LargeMatching) | |
| TEST (BipartiteStress, LargeEvenCycle) | |
| TEST (Bipartite, MultipleEdgesBetweenSameNodes) | |
| TEST (Bipartite, IsolatedNodeWithBipartiteComponent) | |
| TEST (MaximumMatching, DisconnectedComponents) | |
| TEST (MaximumMatching, NodesWithoutArcs) | |
| TEST (BipartiteColor, EnumValues) | |
| TEST (HopcroftKarp, EmptyGraph) | |
| TEST (HopcroftKarp, SingleIsolatedNode) | |
| TEST (HopcroftKarp, SingleEdge) | |
| TEST (HopcroftKarp, PathGraph4) | |
| TEST (HopcroftKarp, PathGraph5) | |
| TEST (HopcroftKarp, CompleteBipartiteK22) | |
| TEST (HopcroftKarp, CompleteBipartiteK33) | |
| TEST (HopcroftKarp, CompleteBipartiteK55) | |
| TEST (HopcroftKarp, UnbalancedK25) | |
| TEST (HopcroftKarp, StarGraph) | |
| TEST (HopcroftKarp, EvenCycle6) | |
| TEST (HopcroftKarp, TriangleThrows) | |
| TEST (HopcroftKarp, OddCycleThrows) | |
| TEST (HopcroftKarp, TwoDisconnectedEdges) | |
| TEST (HopcroftKarp, DisconnectedWithIsolatedNodes) | |
| TEST (HopcroftKarp, TwoDisconnectedCompleteBipartite) | |
| TEST (HopcroftKarp, CrossValidateK44) | |
| TEST (HopcroftKarp, CrossValidatePath6) | |
| TEST (HopcroftKarp, CrossValidateEvenCycle8) | |
| TEST (HopcroftKarp, FunctorWrapper) | |
| TEST (HopcroftKarp, FunctorMatchesFreeFunction) | |
| TEST (HopcroftKarp, StressK50_50) | |
| TEST (HopcroftKarp, StressK100_100) | |
| TEST (HopcroftKarp, StressPath200) | |
| TEST (MaxFlowMatching, ASparseRandomGraphMatchesAsHopcroftKarp) | |
| int | main (int argc, char **argv) |
Tests for Bipartite.
Comprehensive tests for tpl_bipartite.H.
Tests cover:
Definition in file bipartite_test.cc.
| using Graph = List_Graph<Graph_Node<int>, Graph_Arc<Empty_Class> > |
Definition at line 61 of file bipartite_test.cc.
| Graph create_complete_bipartite | ( | size_t | m, |
| size_t | n | ||
| ) |
Creates a complete bipartite graph K_{m,n} Left partition: nodes 0..m-1 Right partition: nodes m..m+n-1.
Definition at line 72 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and m.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Graph create_cycle_graph | ( | size_t | n | ) |
Creates a cycle graph with n nodes: 0–1–2–...–n-1–0 Even cycles are bipartite, odd cycles are not.
Definition at line 119 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and nodes.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Graph create_disconnected_bipartite | ( | ) |
Creates two disconnected components.
Definition at line 176 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| Graph create_path_graph | ( | size_t | n | ) |
Creates a path graph with n nodes: 0–1–2–...–n-1 Path graphs are always bipartite.
Definition at line 98 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and nodes.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Graph create_star_graph | ( | size_t | n | ) |
Creates a star graph with center and n leaves Star graphs are always bipartite.
Definition at line 140 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| Graph create_triangle | ( | ) |
Creates a triangle (K_3) - the simplest non-bipartite graph.
Definition at line 158 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1234 of file bipartite_test.cc.
| TEST | ( | Bipartite | , |
| CompleteBipartiteK22 | |||
| ) |
Definition at line 353 of file bipartite_test.cc.
References create_complete_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| CompleteBipartiteK25 | |||
| ) |
Definition at line 379 of file bipartite_test.cc.
References create_complete_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| CompleteBipartiteK33 | |||
| ) |
Definition at line 366 of file bipartite_test.cc.
References create_complete_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| CompleteGraphK3Throws | |||
| ) |
Definition at line 435 of file bipartite_test.cc.
References create_triangle(), l, and r.
| TEST | ( | Bipartite | , |
| DisconnectedBipartiteComponents | |||
| ) |
Definition at line 489 of file bipartite_test.cc.
References create_disconnected_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| EmptyGraphReturnsEmpty | |||
| ) |
Definition at line 273 of file bipartite_test.cc.
References Aleph::HTList::is_empty(), l, and r.
| TEST | ( | Bipartite | , |
| EvenCycle | |||
| ) |
Definition at line 391 of file bipartite_test.cc.
References create_cycle_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| GraphWithOddCycleAttached | |||
| ) |
Definition at line 445 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, and r.
| TEST | ( | Bipartite | , |
| IsolatedNodeWithBipartiteComponent | |||
| ) |
Definition at line 789 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| LargeOddCycleThrows | |||
| ) |
Definition at line 426 of file bipartite_test.cc.
References create_cycle_graph(), l, and r.
| TEST | ( | Bipartite | , |
| MultipleEdgesBetweenSameNodes | |||
| ) |
Definition at line 770 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, r, and Aleph::DynList< T >::size().
| TEST | ( | Bipartite | , |
| OddCycleThrows | |||
| ) |
Definition at line 417 of file bipartite_test.cc.
References create_cycle_graph(), l, and r.
| TEST | ( | Bipartite | , |
| PathGraphEven | |||
| ) |
Definition at line 312 of file bipartite_test.cc.
References create_path_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| PathGraphOdd | |||
| ) |
Definition at line 326 of file bipartite_test.cc.
References create_path_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| SingleNode | |||
| ) |
Definition at line 283 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, r, and Aleph::DynList< T >::size().
| TEST | ( | Bipartite | , |
| StarGraph | |||
| ) |
Definition at line 338 of file bipartite_test.cc.
References create_star_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| TriangleThrows | |||
| ) |
Definition at line 408 of file bipartite_test.cc.
References create_triangle(), l, and r.
| TEST | ( | Bipartite | , |
| TwoConnectedNodes | |||
| ) |
Definition at line 296 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | Bipartite | , |
| TwoDisconnectedNodes | |||
| ) |
Definition at line 473 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l, r, and Aleph::DynList< T >::size().
| TEST | ( | BipartiteColor | , |
| EnumValues | |||
| ) |
Definition at line 863 of file bipartite_test.cc.
References Aleph::Bp_Blue, Aleph::Bp_Red, and Aleph::Bp_White.
| TEST | ( | BipartiteStress | , |
| LargeBipartiteGraph | |||
| ) |
Definition at line 716 of file bipartite_test.cc.
References create_complete_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | BipartiteStress | , |
| LargeEvenCycle | |||
| ) |
Definition at line 753 of file bipartite_test.cc.
References create_cycle_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | BipartiteStress | , |
| LargePathGraph | |||
| ) |
Definition at line 728 of file bipartite_test.cc.
References create_path_graph(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | ComputeBipartiteClass | , |
| BasicUsage | |||
| ) |
Definition at line 506 of file bipartite_test.cc.
References create_complete_bipartite(), l, r, Aleph::DynList< T >::size(), and verify_bipartition().
| TEST | ( | ComputeBipartiteClass | , |
| ThrowsOnNonBipartite | |||
| ) |
Definition at line 518 of file bipartite_test.cc.
References create_triangle(), l, and r.
| TEST | ( | HopcroftKarp | , |
| CompleteBipartiteK22 | |||
| ) |
Definition at line 935 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| CompleteBipartiteK33 | |||
| ) |
Definition at line 946 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| CompleteBipartiteK55 | |||
| ) |
Definition at line 957 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| CrossValidateEvenCycle8 | |||
| ) |
Definition at line 1127 of file bipartite_test.cc.
References create_cycle_graph(), and Aleph::DynDlist< T >::size().
| TEST | ( | HopcroftKarp | , |
| CrossValidateK44 | |||
| ) |
Definition at line 1099 of file bipartite_test.cc.
References create_complete_bipartite(), and Aleph::DynDlist< T >::size().
| TEST | ( | HopcroftKarp | , |
| CrossValidatePath6 | |||
| ) |
Definition at line 1113 of file bipartite_test.cc.
References create_path_graph(), and Aleph::DynDlist< T >::size().
| TEST | ( | HopcroftKarp | , |
| DisconnectedWithIsolatedNodes | |||
| ) |
Definition at line 1034 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| EmptyGraph | |||
| ) |
Definition at line 877 of file bipartite_test.cc.
References Aleph::Dlink::is_empty().
| TEST | ( | HopcroftKarp | , |
| EvenCycle6 | |||
| ) |
Definition at line 990 of file bipartite_test.cc.
References create_cycle_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| FunctorMatchesFreeFunction | |||
| ) |
Definition at line 1154 of file bipartite_test.cc.
References create_complete_bipartite(), and Aleph::DynDlist< T >::size().
| TEST | ( | HopcroftKarp | , |
| FunctorWrapper | |||
| ) |
Definition at line 1143 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| OddCycleThrows | |||
| ) |
Definition at line 1012 of file bipartite_test.cc.
References create_cycle_graph().
| TEST | ( | HopcroftKarp | , |
| PathGraph4 | |||
| ) |
Definition at line 913 of file bipartite_test.cc.
References create_path_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| PathGraph5 | |||
| ) |
Definition at line 924 of file bipartite_test.cc.
References create_path_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| SingleEdge | |||
| ) |
Definition at line 897 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| SingleIsolatedNode | |||
| ) |
Definition at line 886 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and Aleph::Dlink::is_empty().
| TEST | ( | HopcroftKarp | , |
| StarGraph | |||
| ) |
Definition at line 979 of file bipartite_test.cc.
References create_star_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| StressK100_100 | |||
| ) |
Definition at line 1178 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| StressK50_50 | |||
| ) |
Definition at line 1167 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| StressPath200 | |||
| ) |
Definition at line 1189 of file bipartite_test.cc.
References create_path_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| TriangleThrows | |||
| ) |
Definition at line 1003 of file bipartite_test.cc.
References create_triangle().
| TEST | ( | HopcroftKarp | , |
| TwoDisconnectedCompleteBipartite | |||
| ) |
Definition at line 1065 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), l1, l2, Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| TwoDisconnectedEdges | |||
| ) |
Definition at line 1023 of file bipartite_test.cc.
References create_disconnected_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | HopcroftKarp | , |
| UnbalancedK25 | |||
| ) |
Definition at line 968 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaxFlowMatching | , |
| ASparseRandomGraphMatchesAsHopcroftKarp | |||
| ) |
Definition at line 1203 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), k, l, m, r, OhashCommon< HashTbl, Key >::size(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| CompleteBipartiteK22 | |||
| ) |
Definition at line 583 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| CompleteBipartiteK33 | |||
| ) |
Definition at line 596 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| CompleteBipartiteK55 | |||
| ) |
Definition at line 609 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| DisconnectedComponents | |||
| ) |
Definition at line 813 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| EmptyGraphReturnsEmpty | |||
| ) |
Definition at line 530 of file bipartite_test.cc.
References Aleph::Dlink::is_empty().
| TEST | ( | MaximumMatching | , |
| EvenCycle | |||
| ) |
Definition at line 661 of file bipartite_test.cc.
References create_cycle_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| NodesWithoutArcs | |||
| ) |
Definition at line 835 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::none(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| PathGraph4 | |||
| ) |
Definition at line 557 of file bipartite_test.cc.
References create_path_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| PathGraph5 | |||
| ) |
Definition at line 570 of file bipartite_test.cc.
References create_path_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| SingleEdge | |||
| ) |
Definition at line 542 of file bipartite_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| StarGraph | |||
| ) |
Definition at line 648 of file bipartite_test.cc.
References create_star_graph(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| ThrowsOnNonBipartite | |||
| ) |
Definition at line 674 of file bipartite_test.cc.
References create_triangle().
| TEST | ( | MaximumMatching | , |
| UnbalancedK25 | |||
| ) |
Definition at line 622 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatching | , |
| UnbalancedK52 | |||
| ) |
Definition at line 635 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatchingClass | , |
| BasicUsage | |||
| ) |
Definition at line 689 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| TEST | ( | MaximumMatchingClass | , |
| ThrowsOnNonBipartite | |||
| ) |
Definition at line 701 of file bipartite_test.cc.
References create_cycle_graph().
| TEST | ( | MaximumMatchingStress | , |
| LargeMatching | |||
| ) |
Definition at line 741 of file bipartite_test.cc.
References create_complete_bipartite(), Aleph::DynDlist< T >::size(), and verify_matching().
| bool verify_bipartition | ( | const Graph & | g, |
| const DynDlist< Graph::Node * > & | l, | ||
| const DynDlist< Graph::Node * > & | r | ||
| ) |
Verifies that a bipartition is valid:
Note: This function only verifies edges between nodes that were partitioned. Edges involving non-partitioned nodes (from disconnected components) are ignored.
Definition at line 201 of file bipartite_test.cc.
References Aleph::DynSetTree< Key, Tree, Compare >::contains(), LocateFunctions< Container, Type >::get_it(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), l, Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and r.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| bool verify_matching | ( | const Graph & | g, |
| const DynDlist< Graph::Arc * > & | matching | ||
| ) |
Verifies that a matching is valid:
Definition at line 247 of file bipartite_test.cc.
References Aleph::DynSetTree< Key, Tree, Compare >::contains(), LocateFunctions< Container, Type >::get_it(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), and Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().