Digraphs icon indicating copy to clipboard operation
Digraphs copied to clipboard

planarity-4.x compatibility

Open orlitzky opened this issue 8 months ago • 2 comments

There's a new version of planarity out:

  • https://github.com/graph-algorithms/edge-addition-planarity-suite/releases/tag/Version_4.0.0.0

The headers have been moved around a bit, causing the digraphs build to fail when an external libplanarity (4.x) is used. Here's the lazy version of the patch:

--- a/src/planar.c
+++ b/src/planar.c
@@ -38,10 +38,7 @@
 #include "c/graphK33Search.h"
 #include "c/graphK4Search.h"
 #else
-#include "planarity/graph.h"
-#include "planarity/graphK23Search.h"
-#include "planarity/graphK33Search.h"
-#include "planarity/graphK4Search.h"
+#include "planarity/graphLib.h"
 #endif
 #if defined(__clang__)
 #pragma clang diagnostic pop

No other changes are required though, so it should be possible to support both versions by trying both sets of headers.

orlitzky avatar Apr 01 '25 19:04 orlitzky

I've spent a bit of time trying to update to edge-planarity 4 today. The patch you've suggested above doesn't currently work unfortunately. I could update the vendored version of planarity to v4 without too much trouble. However, it seems that the conda version of planarity is still v3, and so any changes to Digraphs that we might try to include now, would have to detect what version of planarity is available. Because of the wholesale renaming of files in the v4 release, and the fact that in planarity-3.x there is no macro defining the version number, this is more work than I'm willing to undertake at the present time.

I'll happily revisit this when conda includes planarity v4.

james-d-mitchell avatar Apr 08 '25 12:04 james-d-mitchell

No problem, I understand. I could have done it properly myself if not for lack of time.

I've used the patch above on Gentoo where I have the luxury of being able to force external libplanarity >= 4.0. The old header paths like planarity/graphK23Search.h no longer exist in 4.x, so checking for planarity-3.x should be as easy as checking for those headers, and then defining some constant to indicate whether the 3.x or 4.x paths should be used.

orlitzky avatar Apr 10 '25 23:04 orlitzky

Hi Everyone, Wanda sent me a link to this issue, and I just wanted to confirm that we put a better organization of the files in place for 4.0, so including graphLib.h is indeed the "right" way to go for 4.0 and up so that you don't have t worry about where the headers are for the planarity extension algorithms.

john-boyer-phd avatar Sep 24 '25 16:09 john-boyer-phd

@orlitzky @james-d-mitchell Is this now sorted with the merging of #766 and the release of Digraphs v1.13.0?

wilfwilson avatar Sep 26 '25 11:09 wilfwilson

Yep, looks good to me. Thanks!

orlitzky avatar Sep 29 '25 13:09 orlitzky