Hii @cvvergara @robe,
I have a design question about pgr_makeMaximalPlanar.
According to Boost 1.91.0 documentation:
-
make_biconnected_planarrequires a connected planar graph as input -
make_maximal_planarrequires a biconnected planar graph as input.
The official Boost 1.91.0 example for make_maximal_planar (make_maximal_planar.cpp) starts with a path graph (which is connected but NOT biconnected) and calls make_biconnected_planar before calling make_maximal_planar:
So in my current implementation, pgr_makeMaximalPlanar follows this same pattern - it internally calls make_biconnected_planar first, then make_maximal_planar. If a user calls pgr_makeMaximalPlanar on a non-biconnected graph, it won’t give an error, it will silently make it biconnected first and then make it maximal planar.
However, I noticed an inconsistency in Boost’s own examples. The official example for make_biconnected_planar (make_biconnected_planar.cpp) does NOT call make_connected before calling make_biconnected_planar, even though the documentation says make_biconnected_planar requires a connected graph. Boost’s example just uses a graph that happens to already be connected.This raises the same question for pgr_makeBiconnectedPlanar: what if a user passes a disconnected graph? Should we also internally call make_connected first, or just return an error ?(give connected graph as input or empty result)
So the pattern seems inconsistent in boost :
-
make_maximal_planarexample → handles its prerequisite (callsmake_biconnected_planarfirst) -
make_biconnected_planarexample → does NOT handle its prerequisite (does not callmake_connectedfirst)
Also in the existing pgRouting codebase, functions do NOT enforce their prerequisites internally. For example, pgr_dagShortestPath requires the input to be a DAG (Directed Acyclic Graph), but it does NOT check this , it just calls boost::dag_shortest_paths() directly, and if the user passes a graph with cycles, they get an error from Boost.
This confuses me on which approach I should follow for my implementation:
Option A (Matches Boost’s make_maximal_planar.cpp): pgr_makeMaximalPlanar internally calls make_biconnected_planar first. But then by the same logic, shouldn’t pgr_makeBiconnectedPlanar also internally call make_connected first?
Option B (Each function does only its own job): pgr_makeMaximalPlanar only calls make_maximal_planar. If the graph is not biconnected, it returns an empty result or an error(Give biconnected graph as input) . The user must call pgr_makeBiconnectedPlanar separately first. This is consistent with how pgr_makeBiconnectedPlanar currently works (it does not call make_connected internally).
Which approach would you prefer?
Thank you !




