Function breadth_first_order

Function Documentation

std::vector<int> breadth_first_order(std::vector<std::vector<int>> adjacency_matrix, int start_index)

Returns the nodes reachable from start_idx in BFS order.

This function performs a breadth-first search (BFS) on the adjacency matrix.

Parameters:
  • adjacency_matrix – The adjacency matrix representing the graph.

  • start_index – The index of the starting node.