Coder Social home page Coder Social logo

Comments (8)

narayanan2004 avatar narayanan2004 commented on May 30, 2024

The default version of triangle counting assumes a dag. You can try converting your text graph to a binary format dag using the graph_converter tool
bin/graph_converter --uppertriangular 1 --inputformat 1 --outputformat 0 --inputheader 0 --outputheader 1 --nvertices < nvertices > < input text file prefix> < output graphmat file prefix>.
Refer to examples in https://github.com/narayanan2004/GraphMat/wiki/Reading-graph-files if you would rather do the transformation in the code itself. Please let me know if the problem still persists.

from graphmat.

IslandGod avatar IslandGod commented on May 30, 2024

Thank you for fast reply.
I ran the cmd using a mtx file which has no header:

sudo mpirun -np 1 bin/graph_converter --uppertriangular 1 --inputformat 1 --outputformat 0 --inputheader 0 --outputheader 1 --nvertices 4847571 ../../data/soc-LiveJournal0.mtx soc-LiveJournal0.bin
&& ./bin/TriangleCounting soc-LiveJournal0.bin

But I still got the wrong answer:

Reading file: soc-LiveJournal0.bin0
Could not open file: soc-LiveJournal0.bin1
Got: 4847571 by 4847571  vertices
Got: 42851237 edges
Rank 0: Before shuffle 42851237 edges
Rank 0: After shuffle 42851237 edges
num partitions: 384
set_edge_pointers time: 0.564774
Allocating nnz vals: 42851237
fn time: 1.56434
Rank 0: Before shuffle 42851237 edges
Rank 0: After shuffle 42851237 edges
num partitions: 384
set_edge_pointers time: 0.585779
Allocating nnz vals: 42851237
fn time: 1.41217
Finished GraphMat read + construction, time: 5.23209
Completed 1 iterations 
Completed 1 iterations 
Time = 1254.295 ms 
Total triangles = 0 
1 : 0 : 
2 : 0 : 
3 : 0 : 
4 : 0 : 
5 : 0 : 
6 : 0 : 
7 : 0 : 
8 : 0 : 
9 : 0 : 
10 : 0 : 

I do not know the reason causing this problem. Please give me some help.

from graphmat.

narayanan2004 avatar narayanan2004 commented on May 30, 2024

Can you show (say) the first 10 lines of the graph text file?

from graphmat.

IslandGod avatar IslandGod commented on May 30, 2024

This dataset is soc-LiveJournal, which has 4847571 vertices and 68993773 edges. The first 10 lines is as below:

1 2 1
1 3 1
1 4 1
1 5 1
1 6 1
1 7 1
1 8 1
1 9 1
1 10 1

from graphmat.

narayanan2004 avatar narayanan2004 commented on May 30, 2024

I tried running the latest version of GraphMat on the livejournal graph and I get the right answer as below. Can you please make sure you are running the latest version of the code in the master branch?
I made a typo in the command to convert to uppertriangular; you only need to put --uppertriangular not --uppertriangular 1.

Reading file: soc-lj.ut.bin.mtx0
Could not open file: soc-lj.ut.bin.mtx1
Got: 4847571 by 4847571 vertices
Got: 42851237 edges
Rank 0: Before shuffle 42851237 edges
Rank 0: After shuffle 42851237 edges
num partitions: 1408
set_edge_pointers time: 0.746896
Allocating nnz vals: 42851237
fn time: 1.06978
Rank 0: Before shuffle 42851237 edges
Rank 0: After shuffle 42851237 edges
num partitions: 1408
set_edge_pointers time: 0.557166
Allocating nnz vals: 42851237
fn time: 0.816187
Finished GraphMat read + construction, time: 3.35581
Completed 1 iterations
Completed 1 iterations
Time = 936.622 ms
Total triangles = 285730264
1 : 0 :
2 : 2 :
3 : 0 :
4 : 3 :
5 : 9 :
6 : 64 :
7 : 1 :
8 : 0 :
9 : 6 :
10 : 0 :

from graphmat.

narayanan2004 avatar narayanan2004 commented on May 30, 2024

@IslandGod Has this issue been resolved for you?

from graphmat.

IslandGod avatar IslandGod commented on May 30, 2024

I have solved this problem by your approach. Thank you so much!

from graphmat.

IslandGod avatar IslandGod commented on May 30, 2024

from graphmat.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.