Breath First Search
Version 1.0.0.0 (1.82 KB) by
Anh-Dung Nguyen
Breath First Search algorithm to find shortest paths in a network
This implementation of BFS algorithm follows the description in the book "Network: an Introduction - Newman"
Inputs:
- A: the adjacency matrix of the network
- s: starting node
- t: destination node
Outputs:
- shortest_paths: all shortest paths from s to t
- distance: vector containing distances from s to all other nodes
Cite As
Anh-Dung Nguyen (2024). Breath First Search (https://www.mathworks.com/matlabcentral/fileexchange/39763-breath-first-search), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- Sciences > Physics > Networks >
- MATLAB > Mathematics > Graph and Network Algorithms > Construction >
Find more on Networks in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |