142 std::map<int, bool> correct_result;
146 correct_result[0] =
true;
147 correct_result[1] =
true;
148 correct_result[2] =
true;
149 correct_result[3] =
true;
151 std::map<int, bool> returned_result = g.breadth_first_search(2);
153 assert(returned_result == correct_result);
154 std::cout <<
"Test 1 Passed..." << std::endl;
157 returned_result = g.breadth_first_search(0);
159 assert(returned_result == correct_result);
160 std::cout <<
"Test 2 Passed..." << std::endl;
165 g2.
add_edge(
"Gorakhpur",
"Lucknow",
false);
166 g2.
add_edge(
"Gorakhpur",
"Kanpur",
false);
167 g2.
add_edge(
"Lucknow",
"Agra",
false);
168 g2.
add_edge(
"Kanpur",
"Agra",
false);
169 g2.
add_edge(
"Lucknow",
"Prayagraj",
false);
170 g2.
add_edge(
"Agra",
"Noida",
false);
172 std::map<std::string, bool> correct_res;
173 std::map<std::string, bool> returned_res =
175 correct_res[
"Gorakhpur"] =
false;
176 correct_res[
"Lucknow"] =
false;
177 correct_res[
"Kanpur"] =
true;
178 correct_res[
"Agra"] =
true;
179 correct_res[
"Prayagraj"] =
false;
180 correct_res[
"Noida"] =
true;
181 assert(correct_res == returned_res);
182 std::cout <<
"Test 3 Passed..." << std::endl;