XNetwork 1.7.5; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
Functions
testcases.hpp File Reference

Test case generators for XNetwork algorithms. More...

#include <array>
#include <xnetwork/classes/digraphs.hpp>
Include dependency graph for testcases.hpp:

Go to the source code of this file.

Functions

template<typename Container >
auto create_test_case1 (const Container &weights)
 Create a test case with 5 nodes and 5 edges forming a cycle.
 
template<typename Container >
auto create_test_case2 (const Container &weights)
 Create a test case with 3 nodes and bidirectional connections.
 
template<typename Container >
auto create_test_case_timing (const Container &weights)
 Create a timing test case with 3 nodes and bidirectional connections.
 

Detailed Description

Test case generators for XNetwork algorithms.

This file contains functions to generate standard test cases for testing graph algorithms.

Function Documentation

◆ create_test_case1()

template<typename Container >
auto create_test_case1 ( const Container weights)
inline

Create a test case with 5 nodes and 5 edges forming a cycle.

This function creates a directed graph with 5 nodes (A, B, C, D, E) connected in a cycle: A->B->C->D->E->A. Edge weights are assigned from the provided container.

Template Parameters
ContainerThe type of container for weights (should support iteration)
Parameters
weightsA container of weights for the edges
Returns
xnetwork::SimpleDiGraphS A directed graph with the test structure
Note
The graph has the structure: A->B->C->D->E->A

◆ create_test_case2()

template<typename Container >
auto create_test_case2 ( const Container weights)
inline

Create a test case with 3 nodes and bidirectional connections.

This function creates a directed graph with 3 nodes (A, B, C) where each pair of nodes is connected in both directions.

Template Parameters
ContainerThe type of container for weights (should support iteration)
Parameters
weightsA container of weights for the edges
Returns
xnetwork::SimpleDiGraphS A directed graph with the test structure
Note
The graph has the structure: A<->B<->C<->A (all bidirectional)

◆ create_test_case_timing()

template<typename Container >
auto create_test_case_timing ( const Container weights)
inline

Create a timing test case with 3 nodes and bidirectional connections.

This function creates a directed graph with 3 nodes (A, B, C) intended for timing tests, where each pair of nodes is connected in both directions.

Template Parameters
ContainerThe type of container for weights (should support iteration)
Parameters
weightsA container of weights for the edges
Returns
xnetwork::SimpleDiGraphS A directed graph with the test structure
Note
The graph has 6 edges: A<->B, B<->C, C<->A (all bidirectional)