-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtravel_route.h
More file actions
24 lines (21 loc) · 860 Bytes
/
travel_route.h
File metadata and controls
24 lines (21 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include <map>
#include <string>
#include <vector>
/**
* @brief Depth-first search to find the Eulerian path
* @param node current node being visited
* @param adjacency_list adjacency list representing the graph
* @param path Eulerian path
*/
void DepthFirstSearchEulerianPath(const std::string& node,
std::map<std::string, std::vector<std::string>>& adjacency_list,
std::vector<std::string>& path);
/**
* @brief Find the Eulerian path
* @param edges list of vectors represented the edges of the graph
* @param start starting point of the Eulerian Path
* @return Eulerian path as a vector of strings
*/
std::vector<std::string> FindEulerianPath(const std::vector<std::vector<std::string>>& edges,
const std::string& start);