Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
test_data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <graphle.hpp>
5
6#include <array>
7#include <vector>
8
9
10namespace graphle::test {
26 constexpr inline ve_list_graph make_tree_graph(void) {
27 using V = typename ve_list_graph::vertex;
28
29 return ve_list_graph {
30 .vertices { V{0}, V{1}, V{2}, V{3}, V{4}, V{5}, V{6}, V{7}, V{8}, V{9}, V{10} },
31 .edges {
32 { V{0}, V{1} },
33 { V{1}, V{2} }, { V{2}, V{3} }, { V{3}, V{4} },
34 { V{1}, V{5} }, { V{5}, V{6} },
35 { V{6}, V{7} }, { V{6}, V{8} }, { V{6}, V{9} }, { V{6}, V{10} }
36 }
37 };
38 }
39
40
51 constexpr inline ve_list_graph make_dag_graph(void) {
52 using V = typename ve_list_graph::vertex;
53
54 return ve_list_graph {
55 .vertices { V{0}, V{1}, V{2}, V{3}, V{4}, V{5}, V{6}, V{7}, V{8} },
56 .edges {
57 { V{0}, V{2} }, { V{2}, V{6} }, { V{6}, V{7} },
58 { V{1}, V{3} }, { V{3}, V{4} }, { V{4}, V{5} }, { V{5}, V{8} },
59 { V{2}, V{3} },
60 { V{5}, V{6} }
61 }
62 };
63 }
64
65
76 constexpr inline ve_list_graph make_cyclic_graph(void) {
77 using V = typename ve_list_graph::vertex;
78
79 return ve_list_graph {
80 .vertices { V{0}, V{1}, V{2}, V{3}, V{4}, V{5}, V{6}, V{7}, V{8} },
81 .edges {
82 { V{0}, V{2} },
83 { V{1}, V{3} },
84 { V{3}, V{4} }, { V{4}, V{5} }, { V{5}, V{6} }, { V{6}, V{2} }, { V{2}, V{3} },
85 { V{6}, V{7} }, { V{7}, V{8} }, { V{8}, V{5} }
86 }
87 };
88 }
89
90
98 constexpr inline ve_list_graph make_linear_graph(void) {
99 using V = typename ve_list_graph::vertex;
100
101 return ve_list_graph {
102 .vertices { V{0}, V{1}, V{2}, V{3}, V{4}, V{5} },
103 .edges {
104 { V{0}, V{1} }, { V{1}, V{2} }, { V{2}, V{3} }, { V{3}, V{4} }, { V{4}, V{5} }
105 }
106 };
107 }
108
109
121 using V = typename ve_list_graph::vertex;
122
123 return ve_list_graph {
124 .vertices { V{0}, V{1}, V{2}, V{3}, V{4}, V{5} },
125 .edges {
126 { V{0}, V{1} }, { V{1}, V{2} }, { V{2}, V{1} },
127 { V{2}, V{3} }, { V{3}, V{5} }, { V{5}, V{3} }, { V{5}, V{4} }, { V{4}, V{2} }, { V{2}, V{4} }
128 }
129 };
130 }
131
132
140 constexpr inline ve_list_graph make_size_one_graph(void) {
141 using V = typename ve_list_graph::vertex;
142
143 return ve_list_graph { .vertices { V{0} } };
144 }
145
146
151 constexpr inline ve_list_graph make_empty_graph(void) {
152 return ve_list_graph { };
153 }
154
155
160 constexpr inline auto make_graphs(void) {
161 return std::array {
169 };
170 }
171}
constexpr auto make_graphs(void)
Definition: test_data.hpp:160
constexpr ve_list_graph make_empty_graph(void)
Definition: test_data.hpp:151
constexpr ve_list_graph make_tree_graph(void)
Definition: test_data.hpp:26
constexpr ve_list_graph make_dag_graph(void)
Definition: test_data.hpp:51
constexpr ve_list_graph make_size_one_graph(void)
Definition: test_data.hpp:140
constexpr ve_list_graph make_cyclic_graph(void)
Definition: test_data.hpp:76
constexpr ve_list_graph make_linear_graph(void)
Definition: test_data.hpp:98
constexpr ve_list_graph make_bidirectional_edge_graph(void)
Definition: test_data.hpp:120