|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for Random Graph. More...
#include <gtest/gtest.h>#include <random_graph.H>#include <tpl_graph.H>#include <tpl_graph_utils.H>Go to the source code of this file.
Classes | |
| struct | NodeInitializer |
| struct | ArcInitializer |
Typedefs | |
| using | Graph = List_Graph< Graph_Node< int >, Graph_Arc< int > > |
Functions | |
| template<class GT > | |
| bool | is_simple_graph (const GT &g) |
| Verify that a graph has no parallel arcs (simple graph) | |
| template<class GT > | |
| bool | all_nodes_have_even_degree (const GT &g) |
| Verify that all nodes have even degree (necessary for Eulerian) | |
| template<class GT > | |
| bool | satisfies_ore_condition (const GT &g) |
| Verify Ore's theorem condition for Hamiltonian graphs: For all non-adjacent pairs u, v: deg(u) + deg(v) >= n. | |
| TEST (RandomGraph, SparseBasic) | |
| TEST (RandomGraph, SparseConnected) | |
| TEST (RandomGraph, SparseDisconnected) | |
| TEST (RandomGraph, Probability) | |
| TEST (RandomGraph, ProbabilityDense) | |
| TEST (RandomGraph, InvalidProbability) | |
| TEST (RandomGraph, EulerianSparse) | |
| TEST (RandomGraph, EulerianProbability) | |
| TEST (RandomGraph, Hamiltonian) | |
| TEST (RandomGraph, DeterministicSeed) | |
| TEST (RandomGraph, DifferentSeeds) | |
| TEST (RandomGraph, SingleNodeGraph) | |
| TEST (RandomGraph, ZeroNodesRejected) | |
| TEST (RandomGraph, TwoNodeGraph) | |
| TEST (RandomGraph, CompleteGraphLimit) | |
| TEST (RandomGraph, CustomInitializers) | |
Tests for Random Graph.
Definition in file random_graph.cc.
| using Graph = List_Graph<Graph_Node<int>, Graph_Arc<int> > |
Definition at line 47 of file random_graph.cc.
Verify that all nodes have even degree (necessary for Eulerian)
Definition at line 81 of file random_graph.cc.
References GraphCommon< GT, Node, Arc >::get_node_it(), and GraphCommon< GT, Node, Arc >::get_num_arcs().
Verify that a graph has no parallel arcs (simple graph)
Definition at line 55 of file random_graph.cc.
References Aleph::count(), GraphCommon< GT, Node, Arc >::get_arc_it(), GraphCommon< GT, Node, Arc >::get_src_node(), and GraphCommon< GT, Node, Arc >::get_tgt_node().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Verify Ore's theorem condition for Hamiltonian graphs: For all non-adjacent pairs u, v: deg(u) + deg(v) >= n.
Definition at line 95 of file random_graph.cc.
References GraphCommon< GT, Node, Arc >::get_arc_it(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_node_it(), GraphCommon< GT, Node, Arc >::get_num_arcs(), and GraphCommon< GT, Node, Arc >::get_num_nodes().
Referenced by TEST().
| TEST | ( | RandomGraph | , |
| CompleteGraphLimit | |||
| ) |
Definition at line 359 of file random_graph.cc.
| TEST | ( | RandomGraph | , |
| CustomInitializers | |||
| ) |
Definition at line 395 of file random_graph.cc.
| TEST | ( | RandomGraph | , |
| DeterministicSeed | |||
| ) |
Definition at line 279 of file random_graph.cc.
| TEST | ( | RandomGraph | , |
| DifferentSeeds | |||
| ) |
Definition at line 293 of file random_graph.cc.
References is_simple_graph().
| TEST | ( | RandomGraph | , |
| EulerianProbability | |||
| ) |
Definition at line 253 of file random_graph.cc.
References all_nodes_have_even_degree(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::eulerian(), and Aleph::test_connectivity().
| TEST | ( | RandomGraph | , |
| EulerianSparse | |||
| ) |
Definition at line 240 of file random_graph.cc.
References all_nodes_have_even_degree(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::eulerian(), and Aleph::test_connectivity().
| TEST | ( | RandomGraph | , |
| Hamiltonian | |||
| ) |
Definition at line 266 of file random_graph.cc.
References satisfies_ore_condition(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::sufficient_hamiltonian(), and Aleph::test_connectivity().
| TEST | ( | RandomGraph | , |
| InvalidProbability | |||
| ) |
Definition at line 206 of file random_graph.cc.
| TEST | ( | RandomGraph | , |
| Probability | |||
| ) |
Definition at line 175 of file random_graph.cc.
References is_simple_graph().
| TEST | ( | RandomGraph | , |
| ProbabilityDense | |||
| ) |
Definition at line 190 of file random_graph.cc.
References is_simple_graph().
| TEST | ( | RandomGraph | , |
| SingleNodeGraph | |||
| ) |
Definition at line 318 of file random_graph.cc.
| TEST | ( | RandomGraph | , |
| SparseBasic | |||
| ) |
Definition at line 136 of file random_graph.cc.
References is_simple_graph().
| TEST | ( | RandomGraph | , |
| SparseConnected | |||
| ) |
Definition at line 149 of file random_graph.cc.
References is_simple_graph(), and Aleph::test_connectivity().
| TEST | ( | RandomGraph | , |
| SparseDisconnected | |||
| ) |
Definition at line 162 of file random_graph.cc.
References is_simple_graph().
| TEST | ( | RandomGraph | , |
| TwoNodeGraph | |||
| ) |
Definition at line 346 of file random_graph.cc.
References Aleph::test_connectivity().
| TEST | ( | RandomGraph | , |
| ZeroNodesRejected | |||
| ) |
Definition at line 330 of file random_graph.cc.