How to plot connected components in the format of community structure plot?Visualizing subgraphs while specifying the locations of vertexesHow to divide a graph into connected components?How can I highlight and individually color the connected components of a graph?Connected components of a graphExtracting a single weakly connected component from a network of many weakly connected components?How to find number of connected components of graph G?Understanding performance: graph connected componentsVisualizing subgraphs while specifying the locations of vertexesNetwork Graph: show highly connected componentsVertex coloring for bi-connected componentsTrim graph to fully connected components?
Trying to build a function to compute divided difference for arbitrary list of points
A planet illuminated by a black hole?
Convert every file from JPEG to GIF in terminal
Is dd if=/dev/urandom of=/dev/mem safe?
Invert Some Switches on a Switchboard
Why isn't there a ";" after "do" in sh loops?
Why isn't there a serious attempt at creating a third mass-appeal party in the US?
Are there any examples of technologies have been lost over time?
How to deal with a player who makes bad characters and kills them?
Is there a reason why I should not use the HaveIBeenPwned API to warn users about exposed passwords?
Iterate over non-const variables in C++
Explain why watch 'jobs' does not work but watch 'ps' work?
How do campaign rallies gain candidates votes?
401(k) investment after being fired. Do I own it?
Spoken encryption
How do I stop my characters falling in love?
Why can't my huge trees be chopped down?
Giant space birds hatching out of planets; short story
Timing/Stack question about abilities triggered during combat
Basic Questions on Wiener Filtering
Why does RPM for a fixed-pitch propeller change with an aircraft's pitch?
Print sums of all subsets
Is this photo showing a woman posing in the nude before teenagers real?
Did the IBM PC use the 8088's NMI line?
How to plot connected components in the format of community structure plot?
Visualizing subgraphs while specifying the locations of vertexesHow to divide a graph into connected components?How can I highlight and individually color the connected components of a graph?Connected components of a graphExtracting a single weakly connected component from a network of many weakly connected components?How to find number of connected components of graph G?Understanding performance: graph connected componentsVisualizing subgraphs while specifying the locations of vertexesNetwork Graph: show highly connected componentsVertex coloring for bi-connected componentsTrim graph to fully connected components?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I have the following code
plotting community structure of random graph g
. As one can see, the community structure plot presents a nice visual impact. I like to generate a similar plot for the connected components of g
using ConnectedComponents[g]
. HighLightGraph
is showing individual vertices in a given component with the same color but this kind of presentation is not so useful for my purpose. I like to see the components linked to each other through binary links between the components.
SeedRandom[4];
g = RandomGraph[30, 50, DirectedEdges -> True];
gg = ConnectedComponents[g];
CommunityGraphPlot[g, CommunityRegionStyle -> LightGray,
Method -> "Centrality"];
HighlightGraph[g, Subgraph[g, #] & /@ gg];
Thanks.
graphs-and-networks
$endgroup$
add a comment |
$begingroup$
I have the following code
plotting community structure of random graph g
. As one can see, the community structure plot presents a nice visual impact. I like to generate a similar plot for the connected components of g
using ConnectedComponents[g]
. HighLightGraph
is showing individual vertices in a given component with the same color but this kind of presentation is not so useful for my purpose. I like to see the components linked to each other through binary links between the components.
SeedRandom[4];
g = RandomGraph[30, 50, DirectedEdges -> True];
gg = ConnectedComponents[g];
CommunityGraphPlot[g, CommunityRegionStyle -> LightGray,
Method -> "Centrality"];
HighlightGraph[g, Subgraph[g, #] & /@ gg];
Thanks.
graphs-and-networks
$endgroup$
1
$begingroup$
doesCommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?
$endgroup$
– kglr
Jul 17 at 4:19
1
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27
add a comment |
$begingroup$
I have the following code
plotting community structure of random graph g
. As one can see, the community structure plot presents a nice visual impact. I like to generate a similar plot for the connected components of g
using ConnectedComponents[g]
. HighLightGraph
is showing individual vertices in a given component with the same color but this kind of presentation is not so useful for my purpose. I like to see the components linked to each other through binary links between the components.
SeedRandom[4];
g = RandomGraph[30, 50, DirectedEdges -> True];
gg = ConnectedComponents[g];
CommunityGraphPlot[g, CommunityRegionStyle -> LightGray,
Method -> "Centrality"];
HighlightGraph[g, Subgraph[g, #] & /@ gg];
Thanks.
graphs-and-networks
$endgroup$
I have the following code
plotting community structure of random graph g
. As one can see, the community structure plot presents a nice visual impact. I like to generate a similar plot for the connected components of g
using ConnectedComponents[g]
. HighLightGraph
is showing individual vertices in a given component with the same color but this kind of presentation is not so useful for my purpose. I like to see the components linked to each other through binary links between the components.
SeedRandom[4];
g = RandomGraph[30, 50, DirectedEdges -> True];
gg = ConnectedComponents[g];
CommunityGraphPlot[g, CommunityRegionStyle -> LightGray,
Method -> "Centrality"];
HighlightGraph[g, Subgraph[g, #] & /@ gg];
Thanks.
graphs-and-networks
graphs-and-networks
edited Jul 17 at 6:38
user64494
4,1562 gold badges14 silver badges23 bronze badges
4,1562 gold badges14 silver badges23 bronze badges
asked Jul 17 at 3:53
Tugrul TemelTugrul Temel
1,0703 silver badges13 bronze badges
1,0703 silver badges13 bronze badges
1
$begingroup$
doesCommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?
$endgroup$
– kglr
Jul 17 at 4:19
1
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27
add a comment |
1
$begingroup$
doesCommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?
$endgroup$
– kglr
Jul 17 at 4:19
1
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27
1
1
$begingroup$
does
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?$endgroup$
– kglr
Jul 17 at 4:19
$begingroup$
does
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?$endgroup$
– kglr
Jul 17 at 4:19
1
1
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You can use the second argument of CommunityGraphPlot
to specify any community structure (not necessarily a partition of the vertex set).
Using gg
as the community structure
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray]
If you want to retain the layout of the original graph, you can use the function blobF
from this answer to highlight groups of vertices with blobs:
SetProperty[g, PlotTheme->"IndexLabeled", ImageSize -> Large,
Epilog -> blobF[g, RandomColor[Length@gg],gg, .1] ]
SetProperty[g, ImageSize -> Large, Epilog -> blobF[g, RandomColor[Length@gg], gg, .05] ]
$endgroup$
$begingroup$
I am having trouble withSelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?
$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
$begingroup$
@Tugrul, doesSimpleGraph@g
help?
$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph usingSimpleGraph
it drops the vertex names. I also triedSelfLoopStyle
andSelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.
$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question aboutSelfLoops
. Here is the code:SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
$begingroup$
With version 12 updates,SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it asag2 = AdjacencyGraph[Values @ vLabels, am]
, thensg = SimpleGraph[ag2]
retains vertex names:VertexList[sg] == VertexList[ag2]
isTrue
.
$endgroup$
– kglr
Jul 18 at 7:54
|
show 3 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f202220%2fhow-to-plot-connected-components-in-the-format-of-community-structure-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can use the second argument of CommunityGraphPlot
to specify any community structure (not necessarily a partition of the vertex set).
Using gg
as the community structure
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray]
If you want to retain the layout of the original graph, you can use the function blobF
from this answer to highlight groups of vertices with blobs:
SetProperty[g, PlotTheme->"IndexLabeled", ImageSize -> Large,
Epilog -> blobF[g, RandomColor[Length@gg],gg, .1] ]
SetProperty[g, ImageSize -> Large, Epilog -> blobF[g, RandomColor[Length@gg], gg, .05] ]
$endgroup$
$begingroup$
I am having trouble withSelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?
$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
$begingroup$
@Tugrul, doesSimpleGraph@g
help?
$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph usingSimpleGraph
it drops the vertex names. I also triedSelfLoopStyle
andSelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.
$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question aboutSelfLoops
. Here is the code:SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
$begingroup$
With version 12 updates,SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it asag2 = AdjacencyGraph[Values @ vLabels, am]
, thensg = SimpleGraph[ag2]
retains vertex names:VertexList[sg] == VertexList[ag2]
isTrue
.
$endgroup$
– kglr
Jul 18 at 7:54
|
show 3 more comments
$begingroup$
You can use the second argument of CommunityGraphPlot
to specify any community structure (not necessarily a partition of the vertex set).
Using gg
as the community structure
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray]
If you want to retain the layout of the original graph, you can use the function blobF
from this answer to highlight groups of vertices with blobs:
SetProperty[g, PlotTheme->"IndexLabeled", ImageSize -> Large,
Epilog -> blobF[g, RandomColor[Length@gg],gg, .1] ]
SetProperty[g, ImageSize -> Large, Epilog -> blobF[g, RandomColor[Length@gg], gg, .05] ]
$endgroup$
$begingroup$
I am having trouble withSelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?
$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
$begingroup$
@Tugrul, doesSimpleGraph@g
help?
$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph usingSimpleGraph
it drops the vertex names. I also triedSelfLoopStyle
andSelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.
$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question aboutSelfLoops
. Here is the code:SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
$begingroup$
With version 12 updates,SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it asag2 = AdjacencyGraph[Values @ vLabels, am]
, thensg = SimpleGraph[ag2]
retains vertex names:VertexList[sg] == VertexList[ag2]
isTrue
.
$endgroup$
– kglr
Jul 18 at 7:54
|
show 3 more comments
$begingroup$
You can use the second argument of CommunityGraphPlot
to specify any community structure (not necessarily a partition of the vertex set).
Using gg
as the community structure
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray]
If you want to retain the layout of the original graph, you can use the function blobF
from this answer to highlight groups of vertices with blobs:
SetProperty[g, PlotTheme->"IndexLabeled", ImageSize -> Large,
Epilog -> blobF[g, RandomColor[Length@gg],gg, .1] ]
SetProperty[g, ImageSize -> Large, Epilog -> blobF[g, RandomColor[Length@gg], gg, .05] ]
$endgroup$
You can use the second argument of CommunityGraphPlot
to specify any community structure (not necessarily a partition of the vertex set).
Using gg
as the community structure
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray]
If you want to retain the layout of the original graph, you can use the function blobF
from this answer to highlight groups of vertices with blobs:
SetProperty[g, PlotTheme->"IndexLabeled", ImageSize -> Large,
Epilog -> blobF[g, RandomColor[Length@gg],gg, .1] ]
SetProperty[g, ImageSize -> Large, Epilog -> blobF[g, RandomColor[Length@gg], gg, .05] ]
edited Jul 17 at 5:59
answered Jul 17 at 4:27
kglrkglr
207k10 gold badges237 silver badges470 bronze badges
207k10 gold badges237 silver badges470 bronze badges
$begingroup$
I am having trouble withSelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?
$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
$begingroup$
@Tugrul, doesSimpleGraph@g
help?
$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph usingSimpleGraph
it drops the vertex names. I also triedSelfLoopStyle
andSelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.
$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question aboutSelfLoops
. Here is the code:SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
$begingroup$
With version 12 updates,SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it asag2 = AdjacencyGraph[Values @ vLabels, am]
, thensg = SimpleGraph[ag2]
retains vertex names:VertexList[sg] == VertexList[ag2]
isTrue
.
$endgroup$
– kglr
Jul 18 at 7:54
|
show 3 more comments
$begingroup$
I am having trouble withSelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?
$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
$begingroup$
@Tugrul, doesSimpleGraph@g
help?
$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph usingSimpleGraph
it drops the vertex names. I also triedSelfLoopStyle
andSelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.
$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question aboutSelfLoops
. Here is the code:SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
$begingroup$
With version 12 updates,SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it asag2 = AdjacencyGraph[Values @ vLabels, am]
, thensg = SimpleGraph[ag2]
retains vertex names:VertexList[sg] == VertexList[ag2]
isTrue
.
$endgroup$
– kglr
Jul 18 at 7:54
$begingroup$
I am having trouble with
SelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?$endgroup$
– Tugrul Temel
Jul 18 at 3:33
$begingroup$
I am having trouble with
SelfLoops
. In my graph, there are many self loops which I do not want to see. How can you drop them out of the final graph view?$endgroup$
– Tugrul Temel
Jul 18 at 3:33
1
1
$begingroup$
@Tugrul, does
SimpleGraph@g
help?$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
@Tugrul, does
SimpleGraph@g
help?$endgroup$
– kglr
Jul 18 at 3:37
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph using
SimpleGraph
it drops the vertex names. I also tried SelfLoopStyle
and SelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.$endgroup$
– Tugrul Temel
Jul 18 at 6:55
$begingroup$
It works for adjacency matrix, though vertex names are removed, which I do not want.I have been struggling with this problem for a long time. When I plot a graph using
SimpleGraph
it drops the vertex names. I also tried SelfLoopStyle
and SelfLoops
but no success. I have a weighted directed graph with vertex names. I simply like to keep the integrity of the graph but when plotting it I do not want to see the selfloops with vertex names kept.$endgroup$
– Tugrul Temel
Jul 18 at 6:55
1
1
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question about
SelfLoops
. Here is the code: SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
$begingroup$
I was writing a new question but in the meantime I discovered an answer to my question about
SelfLoops
. Here is the code: SeedRandom[1]; am = RandomInteger[0, 1, 10, 10]; ag = AdjacencyGraph[am, VertexLabels -> "Name"]; vLabels = 1 -> AGR, 2 -> FIS, 3 -> CO1, 4 -> CO2, 5 -> MA1, 6 -> MA2, 7 -> EGW, 8 -> CST, 9 -> WHS, 10 -> HOT; SimpleGraph[ag, VertexLabels -> vLabels]
$endgroup$
– Tugrul Temel
Jul 18 at 7:33
1
1
$begingroup$
With version 12 updates,
SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it as ag2 = AdjacencyGraph[Values @ vLabels, am]
, then sg = SimpleGraph[ag2]
retains vertex names: VertexList[sg] == VertexList[ag2]
is True
.$endgroup$
– kglr
Jul 18 at 7:54
$begingroup$
With version 12 updates,
SimpleGraph
works fine (it retains vertex names, edgeweights...) so if your adjacency graph has named vertices, that is, if you define it as ag2 = AdjacencyGraph[Values @ vLabels, am]
, then sg = SimpleGraph[ag2]
retains vertex names: VertexList[sg] == VertexList[ag2]
is True
.$endgroup$
– kglr
Jul 18 at 7:54
|
show 3 more comments
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f202220%2fhow-to-plot-connected-components-in-the-format-of-community-structure-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
does
CommunityGraphPlot[g, gg, CommunityRegionStyle -> LightGray, Method -> "Centrality"]
give what you need?$endgroup$
– kglr
Jul 17 at 4:19
1
$begingroup$
@kglr: Yes, it gives what I want to see. In fact, your solution provides answers to several of my problems. Thank you very much...
$endgroup$
– Tugrul Temel
Jul 17 at 4:27