|
NetOptim 1.2.6
|
Test case generators using Boost Graph Library. More...
#include <boost/graph/adjacency_list.hpp>#include <boost/graph/graph_traits.hpp>#include <py2cpp/nx2bgl.hpp>#include <utility>Go to the source code of this file.
Typedefs | |
| using | graph_t = boost::adjacency_list< boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property< boost::edge_weight_t, int, boost::property< boost::edge_index_t, int > > > |
| Type alias for Boost adjacency list with edge weights and indices. | |
| using | Vertex = boost::graph_traits< graph_t >::vertex_descriptor |
| Type alias for vertex descriptor. | |
| using | Edge_it = boost::graph_traits< graph_t >::edge_iterator |
| Type alias for edge iterator. | |
Functions | |
| template<typename Mapping > | |
| auto | create_test_case1 (const Mapping &weights) -> py::GraphAdaptor< graph_t > |
| Create a simple 5-node cycle test graph. | |
| template<typename Mapping > | |
| auto | create_test_case_timing (const Mapping &weights) -> py::GraphAdaptor< graph_t > |
| Create a 3-node timing test graph with parallel edges. | |
Test case generators using Boost Graph Library.
This module provides factory functions for creating test graphs using the Boost Graph Library (BGL) adjacency list implementation. These test cases are designed for testing network optimization algorithms.
The graphs created are wrapped in py::GraphAdaptor for compatibility with the network optimization algorithms.
| using graph_t = boost::adjacency_list< boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, int, boost::property<boost::edge_index_t, int> >> |
Type alias for Boost adjacency list with edge weights and indices.
|
inline |
Create a simple 5-node cycle test graph.
This function creates a simple directed cycle with 5 vertices. The graph structure is: A -> B -> C -> D -> E -> A This is useful for testing basic cycle detection and ratio algorithms.
| Mapping | Type of weight mapping (edge -> weight) |
| [in] | weights | weights for the edges in order of creation |
|
inline |
Create a 3-node timing test graph with parallel edges.
This function creates a more complex graph with 3 vertices and multiple parallel edges between each pair. This is useful for testing algorithms that need to handle graphs with parallel edges and more complex cycle structures.
The graph includes:
| Mapping | Type of weight mapping (edge -> weight) |
| [in] | weights | weights for the edges in order of creation |