Skip to main content
deleted 2275 characters in body
Source Link
kglr
  • 400.5k
  • 18
  • 488
  • 929
wam={
 {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
  0.180744, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196146, \[Infinity], \[Infinity], 
 0.192559}, 
 {\[Infinity], \[Infinity], 0.199743, 
 0.189167, \[Infinity], 0.177828, 0.136293, 0.198179, 
   0.170862, \[Infinity], \[Infinity], 0.150103, 0.152068, \[Infinity],
  0.145293, 0.147801}, 
 {\[Infinity], 
 0.17492, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196928, \[Infinity], 
 0.18818, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, 
 {\[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity]}, 
 {\[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity]}, 
 {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
 {0.164114, 0.189904, \[Infinity], \[Infinity], \[Infinity], 
 0.142879, \[Infinity], 0.173485, \[Infinity], 0.195519, \[Infinity],
     0.179716, 0.152131, \[Infinity], \[Infinity], 0.197488}, 
 {0.193476,
  0.186542, \[Infinity], 
 0.196847, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], 
     0.184613, \[Infinity], 0.195341, 
 0.190637}, 
 {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, 
 {0.17967, \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
 0.165566, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
 0.16862, \[Infinity], \[Infinity], \[Infinity]}, 
 {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, 
 {\
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, 
 {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
 0.183951, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, 
 {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.189936, 0.16593, 
 0.197014, \[Infinity], \[Infinity], \[Infinity], 
 0.194794, \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
 {0.189579, 0.167198, \[Infinity], \[Infinity], \[Infinity], 
  0.18947, \[Infinity], \[Infinity], \[Infinity], 
 0.187049, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, 
 {\[Infinity], 
 0.149854, \[Infinity], \[Infinity], \[Infinity], 0.188494, 0.150641,
  0.192737, 0.194964, \[Infinity], \[Infinity], \[Infinity], 
   0.14314,
  0.15716, 0.14968, \[Infinity]}
};
wam={
{\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
  0.180744, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196146, \[Infinity], \[Infinity], 
 0.192559}, {\[Infinity], \[Infinity], 0.199743, 
 0.189167, \[Infinity], 0.177828, 0.136293, 0.198179, 
0.170862, \[Infinity], \[Infinity], 0.150103, 0.152068, \[Infinity],
 0.145293, 0.147801}, {\[Infinity], 
 0.17492, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196928, \[Infinity], 
 0.18818, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
{0.164114, 0.189904, \[Infinity], \[Infinity], \[Infinity], 
 0.142879, \[Infinity], 0.173485, \[Infinity], 0.195519, \[Infinity],
0.179716, 0.152131, \[Infinity], \[Infinity], 0.197488}, {0.193476,
 0.186542, \[Infinity], 
 0.196847, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], 
0.184613, \[Infinity], 0.195341, 
 0.190637}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {0.17967, \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
 0.165566, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
 0.16862, \[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, {\
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
 0.183951, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.189936, 0.16593, 
 0.197014, \[Infinity], \[Infinity], \[Infinity], 
 0.194794, \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
{0.189579, 0.167198, \[Infinity], \[Infinity], \[Infinity], 
  0.18947, \[Infinity], \[Infinity], \[Infinity], 
 0.187049, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {\[Infinity], 
 0.149854, \[Infinity], \[Infinity], \[Infinity], 0.188494, 0.150641,
 0.192737, 0.194964, \[Infinity], \[Infinity], \[Infinity], 0.14314,
 0.15716, 0.14968, \[Infinity]}
}
wam={
 {, , , , , ,  0.180744, , , , , , 0.196146, , , 0.192559}, 
 {, , 0.199743, 0.189167, , 0.177828, 0.136293, 0.198179, 
   0.170862, , , 0.150103, 0.152068, , 0.145293, 0.147801}, 
 {, 0.17492, , , , , , 0.196928, , 0.18818, , , , , , }, 
 {, , , , , , , , , , , , , , , }, 
 {, , , , , , , , , , , , , , , }, 
 {, , , , , , , , , , , , , , , }, 
 {0.164114, 0.189904, , , , 0.142879, , 0.173485, , 0.195519, ,
     0.179716, 0.152131, , , 0.197488}, 
 {0.193476, 0.186542, , 0.196847, , , , , , , , , 
     0.184613, , 0.195341, 0.190637}, 
 {, , , , , , , , , , , , , , , }, 
 {0.17967, , , , , 0.165566, , , , , , , 0.16862, , , }, 
 {, , , , , , , , , , , , , , , }, 
 {, , , , , , , , , , , , , , , }, 
 {, , , , , 0.183951, , , , , , , , , , }, 
 {, , , , , 0.189936, 0.16593, 0.197014, , , , 0.194794, , , , }, 
 {0.189579, 0.167198, , , ,  0.18947, , , , 0.187049, , , , , , }, 
 {, 0.149854, , , , 0.188494, 0.150641, 0.192737, 0.194964, , , , 
   0.14314, 0.15716, 0.14968, }
};
edited tags
Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k
Source Link
Tugrul Temel
  • 6.4k
  • 3
  • 14
  • 33

how to successively plot Community Graphs by iteratively using VertexDelete[]

Given the matrix wam:

wam={
{\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
 0.180744, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196146, \[Infinity], \[Infinity], 
0.192559}, {\[Infinity], \[Infinity], 0.199743, 
0.189167, \[Infinity], 0.177828, 0.136293, 0.198179, 
0.170862, \[Infinity], \[Infinity], 0.150103, 0.152068, \[Infinity],
0.145293, 0.147801}, {\[Infinity], 
0.17492, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.196928, \[Infinity], 
0.18818, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
{0.164114, 0.189904, \[Infinity], \[Infinity], \[Infinity], 
0.142879, \[Infinity], 0.173485, \[Infinity], 0.195519, \[Infinity],
0.179716, 0.152131, \[Infinity], \[Infinity], 0.197488}, {0.193476,
0.186542, \[Infinity], 
0.196847, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], 
0.184613, \[Infinity], 0.195341, 
0.190637}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {0.17967, \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
0.165566, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], 
0.16862, \[Infinity], \[Infinity], \[Infinity]}, {\[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, {\
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 
 0.183951, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity]}, {\[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], 0.189936, 0.16593, 
0.197014, \[Infinity], \[Infinity], \[Infinity], 
0.194794, \[Infinity], \[Infinity], \[Infinity], \[Infinity]}, \
{0.189579, 0.167198, \[Infinity], \[Infinity], \[Infinity], 
 0.18947, \[Infinity], \[Infinity], \[Infinity], 
0.187049, \[Infinity], \[Infinity], \[Infinity], \[Infinity], \
\[Infinity], \[Infinity]}, {\[Infinity], 
0.149854, \[Infinity], \[Infinity], \[Infinity], 0.188494, 0.150641,
0.192737, 0.194964, \[Infinity], \[Infinity], \[Infinity], 0.14314,
0.15716, 0.14968, \[Infinity]}
}

I generate the directed graph and its community structure:

 vnames = {"AGF", "OIL", "MA1", "MA2", "EGW", "CST", "WHS", "TRS", 
      "HOT", "INF", "FIN", "EST", "ADM", "EDU", "HLT", "ENT"};
 wag = WeightedAdjacencyGraph[vnames, wam, VertexLabels -> "Name", 
     ImageSize -> 250]
 CommunityGraphPlot[wag, FindGraphCommunities[wag]]

Then I delete a vertex from the graph wag and find the communities in the resulting graph:

vdwag = VertexDelete[wag, {"WHS"}]
FindGraphCommunities[vdwag]
 (* {{"OIL", "MA1", "MA2", "TRS", "HOT", "EST", "EDU", "HLT", 
     "ENT"}, {"AGF", "CST", "INF", "ADM"}, {"EGW"}, {"FIN"}} *)

Then I wanted to draw the communities using:

 CommunityGraphPlot[vdwag, FindGraphCommunities[vdwag]]

However, this does not work, although vdwag is a graph. WHY?