How to check if there is an edge between two nodes in an undirected graph?
Show older comments
How can I check if any two nodes in an undirected graph are connected via an edge or not, please? in other words, Are they neighbors or not? Thanks!
Accepted Answer
More Answers (1)
Pratibha Chaudhary
on 9 Nov 2022
0 votes
findedge(g, node1, node2).
Categories
Find more on Undirected Graphs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!