Check Presence of Specified Edges in Graph
1 次查看(过去 30 天)
显示 更早的评论
I have a digraph G. I also have another digraph H. I want to check whether the edges in H are present in G and highlight those edge that are in common. The command
> findedge(G, H.Edges.Endnodes(:, 1), H.Edges.Endnodes(:, 2))
does not work because it gives an error as soon as an edge in H is absent in G.
Thank you so much.
Kamal
2 个评论
Steven Lord
2021-10-28
Are we allowed to assume that G and H have exactly the same set of nodes, and that the node named (for example) Alice in G is to be considered the same as the node named Alice in H? Or are you trying to do something more like identifying two subgraphs of those digraph objects that are isomorphic, where the node Alice in G could be "associated" with the node Bob in H?
回答(1 个)
Shanmukha Voggu
2021-10-26
Hi Kamal,
There is an error in the command that you provided, please change "Endnodes" to "EndNodes", This will resolve the error hopefully.
The correct command is:
findedge(G, H.Edges.EndNodes(:, 1), H.Edges.EndNodes(:, 2));
Hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!