I have and array with many graphs to which I want to apply an algorithm (below) to each graph in an array that contains all my graphs.
(* g & g1 represent the directed graphs*)
g = Graph[{1 -> 2, 1 -> 3, 1 -> 4, 4 -> 5, 5 -> 6, 3 -> 7, 2 -> 8, 7 -> 9, 9 -> 10, 9 -> 11, 9 -> 12, 8 -> 13, 5 -> 14}];
g1= = Graph[{1 -> 2, 1 -> 3, 1 -> 4, 4 -> 5, 5 -> 6, 3 -> 7, 2 -> 8, 7 -> 9, 9 -> 10, 9 -> 11, 9 -> 12, 8 -> 13, 5 -> 14, 14->13, 14->15, 15->16, 1->17, 1->8}];
(* I define an array with all the graphs*)
allgraphs={g,g1};
(* I define f11 function to use later in the algorithm*)
f11[n_] := n == 0;
(Now, I'm especially having trouble here: I've played around with Map and putting a Table within a Table but my problem is always that I am not able to iterate x[Distributed] for every graph in my array of graphs!)
Table[Probability[x == k, x \[Distributed] VertexDegree[g]], {k,
Max[VertexDegree[g]]}];
Aside: I've tried things like to iterate on all graphs: Table[Probability[x == k, x [Distributed] VertexDegree[j]], {k, Max[VertexDegree[j]]}, {j, allgraphs]; And obviously it doesn't like doing that iteration.
(* I create an array that will list the vertex degrees from 1 to the max degree of the graph*)
Table[a, {a, 1, Max[VertexDegree[g]]}];
(* Combining the two arrays gives me a form {x,y} *)
Table[{%[[i]], %%[[i]]}, {i, Max[VertexDegree[ac]]}];
(* Here I call on my f11 function defined above to delete values with degree=0 because it gives me trouble when I try to plot the log-log form*)
DeleteCases[%, {x_, y_} /; f11[x] \[Or] f11[y]];
Log@%;
(* I define gPlot here, because later I want to populate a grid with the algorithm run on all of my graphs. Currently I copy and paste "gPlot" into my grid and that's why I define the name here*)
gPlot = ListPlot[%, PlotLabel -> "ACC", Filling -> Axis,
PlotMarkers -> Style["\[FilledCircle]", 8, Black],
Joined -> {True}, InterpolationOrder -> 1, Mesh -> Full,
PlotRange -> {{0, 3.5}, {0, -6}}];
So there is it. I want to be able to run the algorithm on every graph in the array allgraphs, so I know I need some sort of iterator but I'm not sure the terminology of the correct process.
Table[stuff, {j, allgraphs}, {k, Max[VertexDegree[j]]}]
$\endgroup$