NetOptim 1.2.6
Loading...
Searching...
No Matches
Namespaces | Typedefs | Enumerations | Functions
test_cases2_boost.hpp File Reference

Alternative test case generators with edge IDs. More...

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
#include <py2cpp/nx2bgl.hpp>
#include <utility>
Include dependency graph for test_cases2_boost.hpp:

Go to the source code of this file.

Namespaces

namespace  boost
 

Typedefs

using graph_t = boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::property< boost::edge_id_tag_t, size_t > >
 Type alias for Boost adjacency list with custom edge ID properties.
 
using Vertex = typename boost::graph_traits< graph_t >::vertex_descriptor
 Type alias for vertex descriptor.
 
using edge_t = typename boost::graph_traits< graph_t >::edge_iterator
 Type alias for edge iterator.
 

Enumerations

enum  boost::edge_id_tag_t { boost::id_tag }
 Custom edge tag for storing unique edge identifiers. More...
 

Functions

 boost::BOOST_INSTALL_PROPERTY (edge, id_tag)
 Install the custom edge property.
 
template<typename Mapping >
auto create_test_case1 (const Mapping &weights) -> py::GraphAdaptor< graph_t >
 Create a simple 5-node cycle test graph with edge IDs.
 
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 and edge IDs.
 

Detailed Description

Alternative test case generators with edge IDs.

This module provides test case generators similar to test_cases_boost.hpp but with additional edge ID properties. The edge IDs are useful for algorithms that need to uniquely identify edges beyond just their endpoints.

This version uses custom edge properties to store unique identifiers, which can be helpful for debugging, tracking, and algorithm implementation.

Typedef Documentation

◆ edge_t

using edge_t = typename boost::graph_traits<graph_t>::edge_iterator

Type alias for edge iterator.

◆ graph_t

using graph_t = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_id_tag_t, size_t> >

Type alias for Boost adjacency list with custom edge ID properties.

◆ Vertex

using Vertex = typename boost::graph_traits<graph_t>::vertex_descriptor

Type alias for vertex descriptor.

Function Documentation

◆ create_test_case1()

template<typename Mapping >
auto create_test_case1 ( const Mapping &  weights) -> py::GraphAdaptor<graph_t>
inline

Create a simple 5-node cycle test graph with edge IDs.

This function creates the same 5-node cycle as in test_cases_boost.hpp but with additional edge ID properties. The graph structure is: A -> B -> C -> D -> E -> A

The edge IDs are automatically assigned during graph construction and can be used to uniquely identify edges in algorithms.

Template Parameters
MappingType of weight mapping (edge -> weight)
Parameters
[in]weightsweights for the edges in order of creation
Returns
py::GraphAdaptor<graph_t> wrapped Boost graph with edge IDs

◆ create_test_case_timing()

template<typename Mapping >
auto create_test_case_timing ( const Mapping &  weights) -> py::GraphAdaptor<graph_t>
inline

Create a 3-node timing test graph with parallel edges and edge IDs.

This function creates the same complex 3-node graph as in test_cases_boost.hpp but with additional edge ID properties. The graph includes multiple parallel edges and bidirectional connections.

The edge IDs are particularly useful here since there are multiple edges between the same pair of vertices, making endpoint-based identification ambiguous.

Template Parameters
MappingType of weight mapping (edge -> weight)
Parameters
[in]weightsweights for the edges in order of creation
Returns
py::GraphAdaptor<graph_t> wrapped Boost graph with edge IDs