question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Triangle count algorithms return different results

See original GitHub issue

Seems #8 was a non-issue but the triangle count algorithms still return different results.

Using az INT64 pattern matrix fixes the inconsistency:

-    "M = Matrix.from_random(BOOL, 100, 100, 10000, no_diagonal=True, make_symmetric=True, seed=42)"
+    "M = Matrix.from_random(INT64, 100, 100, 1000, no_diagonal=True, make_symmetric=True, make_pattern=True, seed=42)"

However, I cannot say that I can fully understand what’s happening here. I’ve also tried introducing semiring=semiring.plus_times_int64 in the mxm operations but it did not change the output in any case.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
michelpcommented, Aug 20, 2020

This is fixed in #72 and now all return the same result 102362.

0reactions
michelpcommented, Feb 25, 2020

Yep @jim22k that’s it, this has bitten me a couple times, should use something like C implicit conversion to consider both sides of the operation.

https://en.cppreference.com/w/c/language/conversion

Read more comments on GitHub >

github_iconTop Results From Across the Web

Triangle Count - Neo4j Graph Data Science
The Triangle Count algorithm counts the number of triangles for each node in the graph. A triangle is a set of three nodes...
Read more >
Fast Counting of Triangles in Large Real Networks: Algorithms ...
TriangleLocal theorems and algorithms, for global and local triangle counting, respectively. Section 4 gives the experimental results on several real data ...
Read more >
Better Algorithms for Counting Triangles in Data Streams
ABSTRACT. We present space-efficient data stream algorithms for approximating the number of triangles in a graph up to a factor 1 + ϵ....
Read more >
A Block-Based Triangle Counting Algorithm on ... - arXiv
Abstract—Triangle counting is a fundamental building block in graph algorithms. In this paper, we propose a block-based triangle.
Read more >
Number of Triangles in an Undirected Graph - GeeksforGeeks
Since a triangle has three vertices and it is counted for every vertex, we need to divide the result by 3. Furthermore, since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found