Given:
ClearAll[vl, el, ew, community, g];
vl = {"stel", "segw", "ma7", "str1", "str3", "str2", "swhl", "sest",
"min", "sfin", "scst", "ma12", "shot", "ma8", "soth", "srtl",
"ma15", "ma6", "str4", "sbus", "ma13"};
el = {"stel" \[DirectedEdge] "segw", "stel" \[DirectedEdge] "ma7",
"segw" \[DirectedEdge] "stel", "segw" \[DirectedEdge] "str1",
"segw" \[DirectedEdge] "str3", "segw" \[DirectedEdge] "str2",
"swhl" \[DirectedEdge] "stel", "swhl" \[DirectedEdge] "sest",
"swhl" \[DirectedEdge] "min", "swhl" \[DirectedEdge] "sfin",
"scst" \[DirectedEdge] "segw", "scst" \[DirectedEdge] "ma12",
"scst" \[DirectedEdge] "shot", "scst" \[DirectedEdge] "ma8",
"scst" \[DirectedEdge] "ma7", "scst" \[DirectedEdge] "soth",
"srtl" \[DirectedEdge] "segw", "srtl" \[DirectedEdge] "swhl",
"srtl" \[DirectedEdge] "ma15", "srtl" \[DirectedEdge] "ma6",
"str1" \[DirectedEdge] "segw", "str1" \[DirectedEdge] "str4",
"str1" \[DirectedEdge] "sbus", "str1" \[DirectedEdge] "str3",
"str1" \[DirectedEdge] "str2", "str1" \[DirectedEdge] "ma7",
"sest" \[DirectedEdge] "swhl", "sest" \[DirectedEdge] "srtl",
"ma12" \[DirectedEdge] "scst", "ma12" \[DirectedEdge] "ma15",
"ma12" \[DirectedEdge] "soth", "shot" \[DirectedEdge] "scst",
"str4" \[DirectedEdge] "scst", "str4" \[DirectedEdge] "ma12",
"ma15" \[DirectedEdge] "srtl", "ma15" \[DirectedEdge] "shot",
"ma15" \[DirectedEdge] "str4", "ma15" \[DirectedEdge] "ma8",
"ma15" \[DirectedEdge] "str3", "ma15" \[DirectedEdge] "str2",
"ma8" \[DirectedEdge] "str1", "ma8" \[DirectedEdge] "str3",
"min" \[DirectedEdge] "sest", "min" \[DirectedEdge] "soth",
"sbus" \[DirectedEdge] "sest", "sfin" \[DirectedEdge] "shot",
"sfin" \[DirectedEdge] "ma6", "ma6" \[DirectedEdge] "ma8",
"ma6" \[DirectedEdge] "min", "ma6" \[DirectedEdge] "ma13",
"str3" \[DirectedEdge] "sbus", "str3" \[DirectedEdge] "str2",
"ma13" \[DirectedEdge] "str3", "str2" \[DirectedEdge] "str3",
"ma7" \[DirectedEdge] "ma13", "soth" \[DirectedEdge] "ma7"};
ew = {0.01313, 0.0139, 0.0131, 0.0188, 0.01145, 0.01842,
0.01786, 0.01203, 0.0137, 0.0188, 0.018, 0.01561, 0.01544,
0.01767, 0.0174, 0.0133, 0.0184, 0.0126, 0.01724, 0.0126,
0.0139, 0.010414`, 0.0169, 0.01498, 0.01736, 0.01832,
0.01211, 0.011911, 0.01586`, 0.01863,0.01653, 0.01533,
0.0129, 0.0121, 0.01144, 0.014, 0.01109, 0.0172, 0.01267,
0.0171, 0.0150, 0.01192, 0.01428, 0.017406, 0.0109,
0.017892, 0.01338, 0.017794, 0.01095, 0.0187, 0.0155,
0.0142, 0.01422, 0.01125, 0.015559, 0.01788};
community = {{"stel", "segw", "str1", "str3", "str2", "sbus"}, {"ma7",
"scst", "ma12", "shot", "soth", "str4"}, {"ma8", "srtl", "ma15",
"ma6", "ma13"}, {"swhl", "sest", "min", "sfin"}};
g = Graph[vl, el, EdgeWeight -> ew];
HighlightGraph[g, Subgraph[g, #] & /@ community,
GraphLayout -> "CircularEmbedding", VertexLabels -> "Name"]
Generates the following circular weighted graph:
I like to have a community graph with the following properties:
- Community graph must take into account edge weights (i.e., use weighted community structure);
- Community elements should be next to each other as a group and default arrows within communities be kept as they are;
- Community area for each community should be of distinct color;
- Between community edges should be normalized and communities be linked with a single arrow with thickness measured by the sum of normalized edge weights;
- Since the incoming and outgoing arrows between communities may be of different thickness (as measured by normalized edge weights), the respective arrows should be shown separately.
The following chart is an example of what I like to create based on the 5 steps above. Within community links should also be shown as a default format.