TADM2E 5.21

From Algorithm Wiki
Revision as of 20:33, 25 March 2015 by Cptsudoku (talk | contribs) (Created page with "Use the BFS starting from the vertex v. For every node keep track of the level from the vertex v. When w is encountered for the first time the level of w is the length of the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Use the BFS starting from the vertex v. For every node keep track of the level from the vertex v. When w is encountered for the first time the level of w is the length of the shortest path. Count how many times you discover w on that level. Stop expanding nodes when you go past the length of the shortest path.