# CommunityGraphPlot of weighted graph: node too far

I am playing with weighted Graph and CommunityGraphPlot, and I am considering the following example.

listWeights = {2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
tab = {UndirectedEdge[3, 1], UndirectedEdge[3, 31], UndirectedEdge[3, 32], UndirectedEdge[3, 33], Table[UndirectedEdge[1, i + 1], {i, 1, 29}]} // Flatten
g = Graph[tab[[All]], EdgeWeight -> Normalize@listWeights]


which reproduce the following Graph

When I use the CommunityGraphPlot to find the communities

CommunityGraphPlot[g, ImageSize -> Full, VertexLabels -> "Name"]


I get

Question: why is the node 2 plotted so far? You can see from the code that it has an unormalized weight of 2, so I was expecting it closest to the node 1.

• Please show a minimal example. Do the weights matter in any way? – Szabolcs Feb 14 at 9:21
• @Szabolcs thanks for the comment. With minimal examples I don't see this behaviour, otherwise I would have posted the most minimal one :) The weights should matter, no? For example, if I set some 0 weight, then I get a different communities plot, where the nodes that have 0 weight with the node 1 generate a separate community. – apt45 Feb 14 at 9:23
• "The weights should matter, no?" Have you actually tried it, or are you just assuming this? I just tried omitting them and it nothing changed. – Szabolcs Feb 14 at 9:24
• @Szabolcs try to set listWeights = {0, 1, 1, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; – apt45 Feb 14 at 9:27
• Just be cautious, test instead of just assuming, and if in doubt, ask Wolfram Support ... I have mixed experiences with asking them about this specific topic, and I am very frustrated by the lack of proper documentation on it. If you have questions about IGraph/M, you can ask me (perhaps use the IGraph/M chatroom) – Szabolcs Feb 14 at 9:50