Graph Class for Weighted Undirected Graph

59 views
Skip to first unread message

dfw...@gmail.com

unread,
Feb 22, 2021, 1:58:29 PM2/22/21
to SNAP Users Group
Hello everyone,

I am new to SNAP and trying to create a "Weighted Undirected Graph". That means, each edge associated with a positive weight. For my case, which Graph Class would be suitable? 

Firstly I was thinking to use TUNGraph(Nodes, Edges). But the problem is, there is no attributes/data associated with the edge/node for this graph class. 

Secondly, I was considering using TNEANet(Nodes, Edges). This class allows me to add edge weight as the attribute.  My data is undirected.  In this case, do I need to add two directed edges from opposite directions between a pair of nodes in order to get all common neighbors? 

Or, would you please suggest the best way to handle this issue? Thank you.

Best regards,
Dewan

Rok Sosic

unread,
Feb 23, 2021, 9:57:03 PM2/23/21
to snap-d...@googlegroups.com

Hi,

Yes, you are correct. Please use TNEANet and add two directed edges for each pair of connected nodes. You can use MakeUnDir() for this purpose, if you already have a graph.

Best,

Rok

--
You received this message because you are subscribed to the Google Groups "SNAP Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snap-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/snap-discuss/0a549c9a-67a8-4618-8144-03b14f0d2f94n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages