How to get GAPBS and Ligra to generate weighted graph with weight 1

We have been trying to generate weighted graph for two popular graph frameworks, GAPBS and Ligra to generate graphs with weights one from SNAP format edge lists. Here are some our experiences.

To get GAPBS to add weights of 1 to your edgelist file 

change the insertWeights to insert 1 instead of random numbers.

https://github.com/sbeamer/gapbs/blob/d7995e1ee58d6ac8c1fde6d3dafd2e73089a93a6/src/builder.h

to generate, just use converter

./converter -f input.el -w -e weighted_input.wel 

to generate a binary weighted graph

./converter -f weighted_input.wel -w -e weighted_input.wsg

To get Ligra to add weights of 1 to your edgelist file 

change the adjGraphAddWeights

https://github.com/jshun/ligra/blob/master/utils/adjGraphAddWeights.C

change the parallel_for that writes to Weights.

A tricky part here is you need to compile this file in the utils directory.

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s