I want to create a gif where a graph is "losing" edges. I have the following code that creates a list of graphs.
eg = {1 <-> 3, 1 <-> 4, 1 <-> 13, 1 <-> 15, 1 <-> 21, 1 <-> 22,
1 <-> 30, 2 <-> 3, 2 <-> 7, 2 <-> 8, 2 <-> 9, 2 <-> 15, 2 <-> 25,
3 <-> 15, 3 <-> 16, 3 <-> 26, 3 <-> 28, 3 <-> 30, 4 <-> 12,
4 <-> 20, 4 <-> 22, 4 <-> 28, 5 <-> 8, 5 <-> 9, 5 <-> 11, 5 <-> 17,
5 <-> 24, 5 <-> 25, 6 <-> 9, 6 <-> 15, 6 <-> 19, 6 <-> 21,
6 <-> 22, 7 <-> 22, 7 <-> 23, 7 <-> 27, 8 <-> 9, 8 <-> 10,
8 <-> 15, 8 <-> 22, 8 <-> 28, 9 <-> 11, 9 <-> 18, 10 <-> 13,
10 <-> 17, 10 <-> 25, 10 <-> 26, 10 <-> 29, 10 <-> 30, 11 <-> 17,
11 <-> 26, 11 <-> 30, 12 <-> 21, 12 <-> 24, 12 <-> 27, 13 <-> 14,
14 <-> 22, 15 <-> 21, 15 <-> 26, 15 <-> 30, 16 <-> 22, 17 <-> 22,
17 <-> 27, 17 <-> 28, 18 <-> 19, 18 <-> 20, 18 <-> 23, 19 <-> 24,
19 <-> 25, 19 <-> 27, 19 <-> 28, 20 <-> 24, 20 <-> 29, 21 <-> 26,
22 <-> 28, 24 <-> 25, 24 <-> 28, 25 <-> 29, 25 <-> 30, 27 <-> 29};
re = {};
be = eg;
ES = Join[Table[i -> {Red, Dashed, Thickness[0.001]}, {i, re}],
Table[i -> {Blue, Thickness[0.005]}, {i, be}]];
glist = {Graph[eg, EdgeStyle -> ES, VertexSize -> 0.7]};
Do[
re = Join[re, RandomChoice[be, 1]];
be = Complement[eg, re];
ES = Join[Table[i -> {Red, Dashed, Thickness[0.001]}, {i, re}],
Table[i -> {Blue, Thickness[0.005]}, {i, be}]];
AppendTo[glist, Graph[eg, EdgeStyle -> ES, VertexSize -> 0.7]],
{i, Length[eg]}]
After that I use Animate
to animate this.
an = Animate[glist[[i]], {i, 1, Length[glist], 1}, DefaultDuration -> 20,
AnimationRepetitions -> 1, AnimationDirection -> Forward]
After that I Export
it to gif.
Export["edgeloss.gif", an, "ControlAppearance" -> None]
The problem I have with this is that the gif loops forwards and then backwards and also loses some of the frames. You can see it here: https://pasteboard.co/H9hZK6D.gif
I tried to export the list of graphs but the graph "vibrates" as frames change which is very annoying. You can see it here: https://pasteboard.co/H9hYhec.gif
Is there a way to have all the frames and having the gif only looping forward? Alternatively, can the list be animated without vibration?