GraphsEvidence Contributing
Multi-Source BFS
Seed the BFS queue with multiple starting nodes simultaneously so distances propagate from all sources in lockstep.
Practice Problems: 3
Difficulty: 0 Easy·3 Medium·0 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Seed the BFS queue with multiple starting nodes simultaneously so distances propagate from all sources in lockstep.