Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About hMetis comment section support #204

Open
wjrforcyber opened this issue Feb 26, 2025 · 3 comments
Open

About hMetis comment section support #204

wjrforcyber opened this issue Feb 26, 2025 · 3 comments

Comments

@wjrforcyber
Copy link

wjrforcyber commented Feb 26, 2025

Why this

Hi!
I tried mt-kahypar on a file I generated by myself, I encountered with the

[hypergraph_io.cpp:readHypergraphFile:441]: Assertion `pos == handle.length` failed:

What

I use a file here:

i10s.txt

How

After I delete the comments section at the end, everything goes well, so maybe you are missing a skip line check on "%" before ASSERT(pos == handle.length)?

@larsgottesbueren
Copy link
Member

FYI, the IDs in hMetis format are 1-based. The second line in your file has a zero.

@wjrforcyber
Copy link
Author

wjrforcyber commented Mar 1, 2025

FYI, the IDs in hMetis format are 1-based. The second line in your file has a zero.

Hi there!
Since what I dumped is from an AIG(AND-INV graph) representation, the index 0 indicates a const(which is not a real node, sometimes it does not have connections to others, but I treated it as a node in case it does have relationship with others), other index are real AND node with complemented edges.
Just curious, does your implementation have condition on this, or could you please show me on which section in the manual have restriction on 1-based node index? I checked on section 3.4 again maybe I miss it? I do see figure 5 start from 1 but don't see any explicit description on this.

@larsgottesbueren
Copy link
Member

Not sure if it's documented. But trust the example in the manual! This fact is moderately well known.
Our implementation relies on this and will break. It will parse the zero correctly [0], but then subtract one [1] as intended, which leads to an underflow to numeric_limits<uint32_t>::max().

[0] /~https://github.com/kahypar/mt-kahypar/blob/master/mt-kahypar/io/hypergraph_io.cpp#L199
[1] /~https://github.com/kahypar/mt-kahypar/blob/master/mt-kahypar/io/hypergraph_io.cpp#L359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants