|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Comprehensive tests for Zero_One_BFS.H. More...
#include <gtest/gtest.h>#include <Zero_One_BFS.H>#include <Dijkstra.H>#include <tpl_graph.H>#include <tpl_sgraph.H>#include <tpl_agraph.H>Go to the source code of this file.
Typedefs | |
| using | GT = List_Graph< Graph_Node< int >, Graph_Arc< int > > |
| using | Node = GT::Node |
| using | Arc = GT::Arc |
| using | DGT = List_Digraph< Graph_Node< int >, Graph_Arc< int > > |
| using | DNode = DGT::Node |
| using | DArc = DGT::Arc |
Functions | |
| TEST (ZeroOneBFS, BasicShortestPath) | |
| TEST (ZeroOneBFS, AllZeroWeights) | |
| TEST (ZeroOneBFS, AllOneWeights) | |
| TEST (ZeroOneBFS, PathToSelf) | |
| TEST (ZeroOneBFS, NoPathExists) | |
| TEST (ZeroOneBFS, SingleNode) | |
| TEST (ZeroOneBFS, LinearChain) | |
| TEST (ZeroOneBFS, ZeroWeightShortcut) | |
| TEST (ZeroOneBFS, NullNodeValidation) | |
| TEST (ZeroOneBFS, EmptyGraphValidation) | |
| TEST (ZeroOneBFS, InvalidWeightValidation) | |
| TEST (ZeroOneBFS, PaintAndGetMinPath) | |
| TEST (ZeroOneBFS, GetDistanceAfterPainting) | |
| TEST (ZeroOneBFS, GetDistanceBeforePainting) | |
| TEST (ZeroOneBFS, PathNodeVerification) | |
| TEST (ZeroOneBFS, CompleteGraphK4) | |
| TEST (ZeroOneBFS, GraphWithCycle) | |
| TEST (ZeroOneBFS, DigraphBasic) | |
| TEST (ZeroOneBFS, DigraphNoReversePath) | |
| TEST (ZeroOneBFS, MultipleComputations) | |
| TEST (ZeroOneBFS, LargeLinearGraph) | |
| TEST (ZeroOneBFS, CrossValidationWithDijkstra) | |
| TEST (ZeroOneBFS, StarGraph) | |
| TEST (ZeroOneBFS, GridExample) | |
| TEST (ZeroOneBFS, TwoNodeZeroWeight) | |
| TEST (ZeroOneBFS, TwoNodeOneWeight) | |
| TEST (ZeroOneBFS, NegativeWeightValidation) | |
| TEST (ZeroOneBFS, StateGetters) | |
| TEST (ZeroOneBFS, DisconnectedPainting) | |
| TEST (ZeroOneBFS, LargeGraphManyZeros) | |
| TEST (ZeroOneBFS, ParallelEdgesKeepSingleParentArcMarked) | |
| TEST (ZeroOneBFS, DestructorRestoresGraphState) | |
Comprehensive tests for Zero_One_BFS.H.
Tests cover correctness, edge cases, validation, and cross-checks against Dijkstra's algorithm for 0-1 weighted graphs.
Definition in file test_zero_one_bfs.cc.
Definition at line 25 of file test_zero_one_bfs.cc.
Definition at line 30 of file test_zero_one_bfs.cc.
| using DGT = List_Digraph<Graph_Node<int>, Graph_Arc<int> > |
Definition at line 28 of file test_zero_one_bfs.cc.
Definition at line 29 of file test_zero_one_bfs.cc.
| using GT = List_Graph<Graph_Node<int>, Graph_Arc<int> > |
Definition at line 23 of file test_zero_one_bfs.cc.
Definition at line 24 of file test_zero_one_bfs.cc.
| TEST | ( | ZeroOneBFS | , |
| AllOneWeights | |||
| ) |
Definition at line 82 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| AllZeroWeights | |||
| ) |
Definition at line 60 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| BasicShortestPath | |||
| ) |
Definition at line 35 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and Aleph::Path< GT >::is_empty().
| TEST | ( | ZeroOneBFS | , |
| CompleteGraphK4 | |||
| ) |
Definition at line 362 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| CrossValidationWithDijkstra | |||
| ) |
Definition at line 504 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| DestructorRestoresGraphState | |||
| ) |
Definition at line 780 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, IS_NODE_VISITED, NODE_COOKIE, Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree(), and Aleph::Spanning_Tree.
| TEST | ( | ZeroOneBFS | , |
| DigraphBasic | |||
| ) |
Definition at line 413 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp().
| TEST | ( | ZeroOneBFS | , |
| DigraphNoReversePath | |||
| ) |
Definition at line 433 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp().
| TEST | ( | ZeroOneBFS | , |
| DisconnectedPainting | |||
| ) |
Definition at line 698 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_distance(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree().
| TEST | ( | ZeroOneBFS | , |
| EmptyGraphValidation | |||
| ) |
Definition at line 224 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), GraphCommon< GT, Node, Arc >::get_num_nodes(), and Aleph::Path< GT >::is_empty().
| TEST | ( | ZeroOneBFS | , |
| GetDistanceAfterPainting | |||
| ) |
Definition at line 292 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_distance(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree().
| TEST | ( | ZeroOneBFS | , |
| GetDistanceBeforePainting | |||
| ) |
Definition at line 316 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_distance(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| GraphWithCycle | |||
| ) |
Definition at line 389 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| GridExample | |||
| ) |
Definition at line 580 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and r.
| TEST | ( | ZeroOneBFS | , |
| InvalidWeightValidation | |||
| ) |
| TEST | ( | ZeroOneBFS | , |
| LargeGraphManyZeros | |||
| ) |
Definition at line 719 of file test_zero_one_bfs.cc.
References Aleph::Array< T >::create(), Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, and nodes.
| TEST | ( | ZeroOneBFS | , |
| LargeLinearGraph | |||
| ) |
Definition at line 479 of file test_zero_one_bfs.cc.
References Aleph::Array< T >::create(), Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, and nodes.
| TEST | ( | ZeroOneBFS | , |
| LinearChain | |||
| ) |
Definition at line 157 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| MultipleComputations | |||
| ) |
Definition at line 455 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| NegativeWeightValidation | |||
| ) |
| TEST | ( | ZeroOneBFS | , |
| NoPathExists | |||
| ) |
| TEST | ( | ZeroOneBFS | , |
| NullNodeValidation | |||
| ) |
Definition at line 209 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| PaintAndGetMinPath | |||
| ) |
Definition at line 265 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_min_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_start_node(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::Path< GT >::is_empty(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::is_painted(), and Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree().
| TEST | ( | ZeroOneBFS | , |
| ParallelEdgesKeepSingleParentArcMarked | |||
| ) |
Definition at line 745 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_distance(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, IS_NODE_VISITED, Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree(), and Aleph::Spanning_Tree.
| TEST | ( | ZeroOneBFS | , |
| PathNodeVerification | |||
| ) |
Definition at line 328 of file test_zero_one_bfs.cc.
References Aleph::DynList< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::Dlink::Iterator::has_curr(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and nodes.
| TEST | ( | ZeroOneBFS | , |
| PathToSelf | |||
| ) |
Definition at line 104 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| SingleNode | |||
| ) |
Definition at line 142 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| StarGraph | |||
| ) |
Definition at line 539 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_distance(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree().
| TEST | ( | ZeroOneBFS | , |
| StateGetters | |||
| ) |
Definition at line 675 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_graph(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_start_node(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::is_painted(), and Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree().
| TEST | ( | ZeroOneBFS | , |
| TwoNodeOneWeight | |||
| ) |
Definition at line 635 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| TwoNodeZeroWeight | |||
| ) |
Definition at line 617 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | ZeroOneBFS | , |
| ZeroWeightShortcut | |||
| ) |
Definition at line 181 of file test_zero_one_bfs.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().