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

wrong treewidth calculated with tdlib #39404

Open
2 tasks done
Ordoviz opened this issue Jan 28, 2025 · 2 comments
Open
2 tasks done

wrong treewidth calculated with tdlib #39404

Ordoviz opened this issue Jan 28, 2025 · 2 comments

Comments

@Ordoviz
Copy link
Contributor

Ordoviz commented Jan 28, 2025

Steps To Reproduce

No response

Expected Behavior

sage: g=Graph('J??s[`HS@O_')
sage: g.treewidth(algorithm='tdlib')
3
sage: g.treewidth(algorithm='sage')
3

This graph has treewidth 3 according to HoG.

Actual Behavior

sage: g=Graph('J??s[`HS@O_')
sage: g.treewidth(algorithm='tdlib')
4
sage: g.treewidth(algorithm='sage')
3

Additional Information

@felix-salfelder This issue is similar to #38159. The graph J??s[`HS@O_ is given in .gr format below:

p tw 11 15
1 7
1 8
2 9
2 10
3 6
3 11
4 6
4 8
4 10
5 7
5 9
5 11
6 7
8 9
10 11

Environment

  • OS: Arch Linux with treedec 0.9.3 (I also tried tdlib 0.9.3+ built from source, no difference)
  • Sage Version: 10.5 (I also tried 10.6.beta5 via sagemath-git, no difference)

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@Ordoviz Ordoviz added the t: bug label Jan 28, 2025
@Ordoviz
Copy link
Contributor Author

Ordoviz commented Jan 28, 2025

I found the smallest graph for which g.treewidth(algorithm='tdlib') != g.treewidth(algorithm='sage'). It has 10 vertices:

sage: g=Graph('I@?LShgTG')
sage: g.treewidth(algorithm='tdlib')
4
sage: g.treewidth(algorithm='sage')
3

p tw 10 15
1 7
1 8
2 9
2 10
3 4
3 7
3 9
4 8
4 10
5 6
5 7
5 9
6 8
6 10
9 10

@felix-salfelder
Copy link

Thank you, very useful. Definitely a bug, possibly to do with preprocessing. I tried

$ ./tdecomp --ex17 < sage_bug_39404.gr > ex17.td
$ ./tdecomp --ta < sage_bug_39404.gr > ta.td
$ grep ^s ta.td ex17.td
ta.td:s td 7 4 10
ex17.td:s td 7 5 10  <= !!
$ td-validate sage_bug_39404.gr ta.td 
valid
$ td-validate sage_bug_39404.gr ex17.td 
valid

iirc ex17 == pp+ta, but I need more time to debug.

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

No branches or pull requests

3 participants