Add edges to a graph without changing original topology

2 visualizaciones (últimos 30 días)
Tejas Adsul
Tejas Adsul el 16 de Feb. de 2020
Comentada: Walter Roberson el 16 de Feb. de 2020
Consider the following graph
s = [1 1 1 2];
t = [2 3 4 3];
G = graph(s,t)
plot(G)
G = addedge(G,[1 2],[5 5])
hold on
plot(G)
This gives
Is it possible to add new edges to the original (blue) graph without changing its topology? My purpose is to create an animation where I can see additional nodes and edges being added to an initial topology in each iteration. I don't want the topology to change at every iteration.
Thank you!
  1 comentario
Walter Roberson
Walter Roberson el 16 de Feb. de 2020
By definition, NO, any addition of an edge to a Graph changes its topology.
I wonder if you are instead concerned about the layout of the graph? You can control where the vertices are drawn; see the plot() method for graph()

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by