I am new to Mathematica. I created a code where I can evaluate a parameter (denoted by PoA) for a random instance of a directed acyclic graph. The code is below.
an = 10;
al = 1;
nodes = 10;
links = 25;
s = DirectedGraph[RandomGraph[{nodes, links}], "Acyclic"];
M = al*Transpose[AdjacencyMatrix[s]];
id = an + al*VertexInDegree[s];
od = al*VertexOutDegree[s];
wd = -Log[1 - (od/id)];
wd // MatrixForm
x = (DiagonalMatrix[id] - M).wd;
poa = N[od - x, 4]
PoA = Total@poa;
I now want to generate plots of average PoA vs. nodes, by varying 'nodes' from 5 to 50 and finding average of 1000 instances of PoA. Similarly I want to set nodes to 35 and vary connectivity (defined as links/nodes) and get a plot to find average PoA. How to reuse and extend this code to do the same? Thanks!