71 constexpr int INFINITY_INT = std::numeric_limits<int>::max();
72 constexpr float INFINITY_FLOAT = std::numeric_limits<float>::max();
73 constexpr double INFINITY_DOUBLE = std::numeric_limits<double>::max();
74 constexpr uint32_t INFINITY_UINT32 = UINT32_MAX;
77 std::cout <<
"\nTest Case 1 :\n";
78 std::array<std::array<int, 6>, 6> graph1{
79 0, 4, 1, 4, INFINITY_INT, INFINITY_INT,
80 4, 0, 3, 8, 3, INFINITY_INT,
81 1, 3, 0, INFINITY_INT, 1, INFINITY_INT,
82 4, 8, INFINITY_INT, 0, 5, 7,
83 INFINITY_INT, 3, 1, 5, 0, INFINITY_INT,
84 INFINITY_INT, INFINITY_INT, INFINITY_INT, 7, INFINITY_INT, 0};
88 std::cout <<
"\nTest Case 2 :\n";
89 std::array<std::array<float, 3>, 3> graph2{
90 0.0f, 2.5f, INFINITY_FLOAT,
92 INFINITY_FLOAT, 3.2f, 0.0f};
96 std::cout <<
"\nTest Case 3 :\n";
97 std::array<std::array<double, 5>, 5> graph3{
98 0.0, 10.5, INFINITY_DOUBLE, 6.7, 3.3,
99 10.5, 0.0, 8.1, 15.4, INFINITY_DOUBLE,
100 INFINITY_DOUBLE, 8.1, 0.0, INFINITY_DOUBLE, 7.8,
101 6.7, 15.4, INFINITY_DOUBLE, 0.0, 9.9,
102 3.3, INFINITY_DOUBLE, 7.8, 9.9, 0.0};
106 std::cout <<
"\nTest Case 4 :\n";
107 std::array<std::array<int, 3>, 3> graph_neg{
114 std::cout <<
"\nTest Case 5 :\n";
115 std::array<std::array<int, 3>, 3> graph_self_loop{
122 std::cout <<
"\nTest Case 6 :\n";
123 std::array<std::array<int, 4>, 4> no_edges{
124 0, INFINITY_INT, INFINITY_INT, INFINITY_INT,
125 INFINITY_INT, 0, INFINITY_INT, INFINITY_INT,
126 INFINITY_INT, INFINITY_INT, 0, INFINITY_INT,
127 INFINITY_INT, INFINITY_INT, INFINITY_INT, 0};
131 std::cout <<
"\nTest Case 7:\n";
132 std::array<std::array<int, 4>, 4> partial_graph{
133 0, 2, INFINITY_INT, 6,
134 2, 0, 3, INFINITY_INT,
135 INFINITY_INT, 3, 0, 4,
136 6, INFINITY_INT, 4, 0};
141 std::cout <<
"\nTest Case 8:\n";
142 std::array<std::array<int, 4>, 4> directed_graph{
143 0, 3, 7, INFINITY_INT,
144 INFINITY_INT, 0, 2, 5,
145 INFINITY_INT, INFINITY_INT, 0, 1,
146 INFINITY_INT, INFINITY_INT, INFINITY_INT, 0};
150 std::cout <<
"\nTest Case 9:\n";
151 std::array<std::array<int, 4>, 3> graph9{
158 std::cout <<
"\nTest Case 10:\n";
159 std::array<std::array<int, 5>, 5> graph10{
168 std::cout <<
"\nTest Case 11 :\n";
169 std::array<std::array<uint32_t, 4>, 4> graph_uint32{
170 0, 5, INFINITY_UINT32, 9,
171 5, 0, 2, INFINITY_UINT32,
172 INFINITY_UINT32, 2, 0, 6,
173 9, INFINITY_UINT32, 6, 0};
176 std::cout <<
"\nAll tests have successfully passed!\n";