Go back to breadth first search for path finding.
If 1.1.x nodes using Dijkstra's algorithm are mixed with 1.0.x nodes using BFS, then routing loops can occur.
This commit is contained in:
parent
36623e15a1
commit
8b1ad6f76f
1 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@
|
||||||
Please note that sorting on weight is already done by add_edge().
|
Please note that sorting on weight is already done by add_edge().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void mst_kruskal(void) {
|
static void mst_kruskal(void) {
|
||||||
splay_node_t *node, *next;
|
splay_node_t *node, *next;
|
||||||
edge_t *e;
|
edge_t *e;
|
||||||
node_t *n;
|
node_t *n;
|
||||||
|
@ -216,7 +216,7 @@ static void sssp_dijkstra(void) {
|
||||||
Running time: O(E)
|
Running time: O(E)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void sssp_bfs(void) {
|
static void sssp_bfs(void) {
|
||||||
splay_node_t *node, *to;
|
splay_node_t *node, *to;
|
||||||
edge_t *e;
|
edge_t *e;
|
||||||
node_t *n;
|
node_t *n;
|
||||||
|
@ -369,7 +369,7 @@ static void check_reachability(void) {
|
||||||
|
|
||||||
void graph(void) {
|
void graph(void) {
|
||||||
subnet_cache_flush();
|
subnet_cache_flush();
|
||||||
sssp_dijkstra();
|
sssp_bfs();
|
||||||
check_reachability();
|
check_reachability();
|
||||||
mst_kruskal();
|
mst_kruskal();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue