Check Presence of Specified Edges in Graph

1 visualización (últimos 30 días)
Kamal Premaratne
Kamal Premaratne el 23 de Oct. de 2021
Comentada: Kamal Premaratne el 29 de Oct. de 2021
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 comentarios
Steven Lord
Steven Lord el 28 de Oct. de 2021
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?
Kamal Premaratne
Kamal Premaratne el 29 de Oct. de 2021
Thank you Steven.
-- No, G and H may not have the same set of nodes.
-- If G has a node named "Alice" and H also has a node named "Alice", then yes, both are the same.
-- Perhaps it is better if I mention the particular dataset that I am working with.
C = digraph representing C elegance (https://wormwiring.org/pages/software.html).
G = a particular subgraph of C (which I generate via a spectral clutering algorithm).
H = Navigation circuit of C [Gray2005PNAS].
My main objective is to determine how much of the Nav circuit in H is captured in the subgraph G. The problem is that each node in H is a "proxy" for a set of nodes. For instace, node "AIB" in C is a proxy for both "AIBL" and "AIBR" that appear in C. So, an edge in H becomes a proxy for a set of edges in C. For instance, take the edge AIB > AIA in H. AIB is a proxy for AIBL and AIBR. Similarly, AIA is a proxy for AIAL and AIAR. So, the edge AIB > AIA in H is a proxy for 4 edges in C. Does G contain all 4, only some of the 4, or none of these 4 edges? That's what I want to find out.
Thank you so much.
Kamal
[Gray2005PNAS] Gray, Hill, Bargmann (2005). A circuit for navigation in Caenorhabditis elegans. PNAS 102(9) 3184–3191.

Iniciar sesión para comentar.

Respuestas (1)

Shanmukha Voggu
Shanmukha Voggu el 26 de Oct. de 2021
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));
Refer to this for more information.
Hope this helps!
  1 comentario
Kamal Premaratne
Kamal Premaratne el 28 de Oct. de 2021
Thank you Shanmuka for pointing out the typo (it should be "EndNodes" and not Endnodes").
But, this does not resolve the problem. If any edge in H that is specified through H's EndNodes table is absent in G, MATLAB spits out an error.

Iniciar sesión para comentar.

Categorías

Más información sobre Graph and Network Algorithms en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by