Can I preserve adding order when calling graph/addedge?
Mostrar comentarios más antiguos
Hi when calling graph/addedge. The added edge are re-ordered from the adding order. For example:
>> g = graph;
>> g = graph;
>> g = g.addedge(5, 6);
>> g = g.addedge(1, 2);
>> g.Edges
ans =
2×1 table
EndNodes
________
1 2
5 6
Is there a way to avoid this re-order?
This question comes from a requirement that I would like to remember indices of some edges for quick access. However, if calling addedge the indices will be then dis-ordered. It is not suitable to look up edge by EndNodes in my case because the graph can contain multi-edges.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Graph and Network Algorithms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!