| 90 | } |
| 91 | |
| 92 | void ViewGraph::BFS(image_t root, |
| 93 | std::unordered_map<image_t, bool>& visited, |
| 94 | std::unordered_set<image_t>& component) { |
| 95 | std::queue<image_t> q; |
| 96 | q.push(root); |
| 97 | visited[root] = true; |
| 98 | component.insert(root); |
| 99 | |
| 100 | while (!q.empty()) { |
| 101 | image_t curr = q.front(); |
| 102 | q.pop(); |
| 103 | |
| 104 | for (image_t neighbor : adjacency_list[curr]) { |
| 105 | if (!visited[neighbor]) { |
| 106 | q.push(neighbor); |
| 107 | visited[neighbor] = true; |
| 108 | component.insert(neighbor); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | void ViewGraph::EstablishAdjacencyList() { |
| 115 | adjacency_list.clear(); |
nothing calls this directly
no outgoing calls
no test coverage detected