diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-02-04 00:17:12 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-02-04 00:17:12 +0100 |
commit | 19390ab685d27f2b2c3153dd53b5661998edcfaf (patch) | |
tree | 55526002ad84678c713c0def66b7eecd411b1d12 /src/lib/eina_graph_bfs.h | |
parent | ec2f079b5bdcee15213d05bd1a81e90f9175f215 (diff) | |
download | eina_graph-19390ab685d27f2b2c3153dd53b5661998edcfaf.zip eina_graph-19390ab685d27f2b2c3153dd53b5661998edcfaf.tar.gz |
implement eina_graph_bfs_shortest_path() with tests
Diffstat (limited to 'src/lib/eina_graph_bfs.h')
-rw-r--r-- | src/lib/eina_graph_bfs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/eina_graph_bfs.h b/src/lib/eina_graph_bfs.h index 77d8b3c..f367cf4 100644 --- a/src/lib/eina_graph_bfs.h +++ b/src/lib/eina_graph_bfs.h @@ -39,6 +39,19 @@ typedef struct _Eina_Graph_BFS_Opaque Eina_Graph_BFS; /** + * return the path to reach the given destination from the source. + * + * @param g the graph to compute the shortest path on. + * @param s the source vertex. + * @param d the destination vertex. + * + * @return a list of vertices to follow from source to reach v, + * NULL if v is not reachable. + */ +EAPI Eina_List * +eina_graph_bfs_shortest_path(Eina_Graph *g, unsigned int s, unsigned int d); + +/** * returns a Breadth First Search of the given graph. * * @param g the graph to build the BFS from. |