Repository navigation
Releases
ogdf-py 0.6.1
Changes since the last Release
Security
-
The OGDF bootstrap verifies that the pinned tag resolves to the commit in
scripts/ogdf-commit.txtand refuses the clone otherwise. A moved tag, or anOGDF_REPOpointing elsewhere, would have changed the code statically linked into published wheels without changing any cache key. An overriddenOGDF_TAGis checked against the tag instead. -
--archive/OGDF_ARCHIVEtarballs are extracted with thedatafilter, or an equivalent member check on interpreters without it. On Python 3.10-3.13 a crafted archive could write outside the extraction directory.
Changed
-
Build requirements are bounded at the next major version:
nanobind>=3.0,<4,scikit-build-core>=0.12.2,<2. A new major could break sdist builds of an already released version. Builds were already resolving nanobind 3.1.0, so the floor matches what is tested. -
Wheels no longer contain the C++ binding sources (about 130 KB), and the sdist no longer contains
.github/orTODO.md. PyPI shows repository, documentation, changelog and issue links, and the keywords describe the package. -
make publishandmake publish-testare removed: a local wheel is tagged for the build machine (macosx_26_0_arm64, or an unrepairedlinux_x86_64that PyPI rejects). Publishing goes throughbuild-publish.yml. -
shortest_pathsraisesPreconditionErrorwhen it would use Bellman-Ford withdirected=False, the default.algorithm="auto"picks Bellman-Ford when anEdgeArrayIntholds a negative length, and it used to switch to directed semantics silently: ona->b, c->bwith one negative length,cwent from distance 2 to unreachable. Passdirected=True. -
SpringEmbedderKK,StressMinimizationandPivotMDScount as layouts.layout(g, "SpringEmbedderKK")raised "unknown layout", andabout()reported 19 layouts and 27 types instead of 22 and 24. Layouts are now the classes with acallmethod rather than those named*Layout.
Fixed
-
Wheels are built for the instruction-set baseline (
-march=x86-64/-march=armv8-a). OGDF's CMake defaults to-march=nativeon GCC and Clang, so 0.5.1 and 0.6.0 wheels contain instructions of the CI runner that built them: the 0.6.0 manylinux and macOS x86_64 wheels use AVX2 and FMA, and the manylinux aarch64 wheel uses SVE. They can crash with an illegal instruction on CPUs without those extensions, which includes most aarch64 machines without SVE (for example AWS Graviton2 and Raspberry Pi). macOS arm64 and Windows wheels were not affected. The same default made a CI cache built on one runner crash another.OGDF_ARCH=nativerestores the old behaviour for local builds. -
validate("TreeLayout", g), and solayout(g, TreeLayout), rejected undirected forests such as0->1, 2->1thatTreeLayoutdraws. The"forest"property tested for rooted forests; it now tests for an undirected cycle, matching the binding.graph_report()["forest"]changes with it. -
layout(seed=...)andcompare_layouts(seed=...)now updateprovenance()["seed"]; they seeded the engine without recording it. -
separation_pairraisesInvalidGraphErroron a graph that is not biconnected. It returnedNone, which means "triconnected", for a path. -
OGDF's own exceptions reach Python as
AlgorithmError(forAlgorithmFailureException) orOGDFError.ogdf::Exceptionderives privately fromstd::exception, so nanobind's fallback could not catch it.maximum_weight_matchingrejects self-loops withInvalidGraphError; Blossom V raised a bareRuntimeError. -
fill_node_array/fill_edge_arraywithkeysskip elements missing fromkeys, as documented; they raisedKeyError. -
The bootstrap re-fetches an OGDF checkout that no longer matches the pin, for example after a tag bump. It reused the old source and compiled the new tag into
ogdf.about(), which then reported the wrong OGDF version. Sources supplied with--archiveor--source-dirare used as they are. -
make typecheck(and somake qa) covers the same paths as CI; ruff and mypy now also coverscripts/, which the release path runs.make distcleanremoves the docs site and the OGDF checkout, as its help says.make buildon Windows no longer re-bootstraps every run (the library isOGDF.libthere). -
CI builds the docs with
mkdocs build --strict, and runs on Ubuntu and macOS with Python 3.10 and 3.14 in addition to Ubuntu with 3.13. -
docs/coverage.mdno longer lists packing and connectivity augmentation as excluded while marking them bound, or lists three items twice. Snippets indocs/getting-started.mdanddocs/metrics.mdrun top to bottom. -
fit_to_boxrejects NaN and infinite sizes and margins. -
PivotMDSandStressMinimizationcompute 2D layouts even when theGraphAttributeshas thethreeDflag, whichALL_ATTRIBUTESandlayout()set. The bindings expose onlyxandy. For a graph whose distances fit in a plane, such as a triangle, the third eigenvalue is 0, and OGDF's unbounded power iteration inPivotMDSnever converged under MSVC: the Windows test run hung. -
CI jobs time out after 30 minutes (wheel jobs after 60) instead of GitHub's 6 hours, and pytest dumps the stack of a test stuck for 5 minutes. An infinite width passed the positivity check and left every coordinate at
+-1.8e308.
ogdf-py 0.6.0
Changes since the last Release
Added
-
Pushing a release tag now creates the GitHub release, with all wheels, the sdist, and the matching CHANGELOG section as notes. Tag pushes no longer publish to TestPyPI or PyPI; a manual run of
build-publish.ymldoes, with thetestpypiandpypiinputs (both off by default). The README now givespip install ogdf-py. -
The project is now licensed under the GPL, version 2 or 3, with the same linking exception for COIN-OR and Tulip that OGDF grants; it was MIT. Every wheel statically links OGDF, which is GPL v2/v3, so the wheels were never distributable as MIT-only.
pyproject.tomldeclaresGPL-2.0-only OR GPL-3.0-only. Released versions keep their MIT licence. -
Wheels ship OGDF's licence texts (
LICENSE.txt, GPL v2 and v3, Minisat) underogdf/_licenses/ogdf/. The extension links OGDF statically, so the texts must travel with the binary.
Changed
-
to_networkxreturns an undirected graph unlessdirected=Trueis passed. It used to readGraphAttributes.directed, which OGDF sets toTrueby default, soto_networkx(g, ogdf.layout(g))returned aDiGraphfor an undirected graph. Changing OGDF's default instead would remove arrowheads from every default SVG and TikZ drawing. -
min_spanning_treeuses Kruskal and returns a minimum spanning forest. OGDF's Prim started from the first node, so on a disconnected graph it covered one component; the docstring already promised a forest. -
set_seedaccepts[-2**31, 2**32), andnew_seed()returns values in[0, 2**32)on every platform.set_seedaccepted int32 only, so about half of drawn seeds raisedTypeError. OGDF'srandomSeed()computes inuint_fast32_t, which is 64 bits under libstdc++, so on Linuxnew_seed()also returned values up to about7 * 2**32. Values outside the range raisePreconditionError(aValueError).
Fixed
-
Inputs that broke an OGDF precondition now raise
PreconditionErrororInvalidGraphErrorinstead of segfaulting, hanging, or returning a wrong result. OGDF checks its preconditions only in debug builds. Findings C1-C14 and P1 inREVIEW.mdlist each case;tests/test_safety.pycovers them. The main classes:GraphAttributesaccessors, layouts, metrics, transforms and SVG/TikZ output check the attribute flags they read. A defaultGraphAttributessegfaulted onset_node_label.- A handle whose element was deleted, or whose graph was cleared or destroyed, is rejected with a
TypeError(and a nanobindRuntimeWarning) instead of reading freed memory. If OGDF later reuses the address for a new element of the same kind, the old handle names that element. A side table keyed by address made array access and generators 3x slower, because each lookup missed the cache; marking the Python object invalid costs nothing per access. - Arrays,
GraphAttributes, and node/edge arguments from a different graph are rejected.connected_componentswith another graph's array returned 16 for a 200000-node graph and wrote out of bounds. FPPLayout,MixedModelLayout,SchnyderLayout,DominanceLayoutandVisibilityLayoutrequire a connected graph, andvalidate()reports it.validate()returned[]for inputs that then segfaulted.- Generators validate sizes, degrees, probabilities and parity, and reject aliased graph arguments. Impossible
random_regular_graphandrandom_watts_strogatz_grapharguments looped forever;cube_graph(g, 40)overflowed to 256 nodes. planar_embed_planar_graphrejects non-planar input; on K5 it added two nodes and marked the result embedded.min_cost_flowchecks connectivity, bounds and supply balance, and verifies OGDF's result. OGDF's Reinelt solver reports success with zero flow on a one-edge network; that now raisesAlgorithmError.bellman_fordno longer relaxes edges out of unreachable nodes. OGDF added edge lengths to itsINT_MAXsentinel, which overflowed and gave every node downstream of an unreachable one a wrong distance. Lengths whose absolute sum reaches2**31 - 1are rejected.- NaN weights and capacities are rejected wherever negative ones were.
PivotMDS.set_edge_costs(0)(an endless loop) andSugiyamaLayout.set_runs(0)are rejected.
-
make cleandeleted every.sounder the repository, including the 241 in.venv. It now cleanssrc/only. -
The tag trigger matched only
v*, but every release tag so far is bare (0.5.1). Tag pushes never ran the publish jobs, so each release went out by manual dispatch. The trigger now matches bare tags, andmake releasecreates them instead ofv-prefixed ones. A tag that disagrees withpyproject.tomlfails the sdist job before any wheel builds. -
The two
0.5.0strings indocs/getting-started.mdare now0.5.1, andmake releaserewrites them along withpyproject.toml.test_provenance_example_keys_matchcompares the documentedpackage_versionagainst the installed one, so a version bump that touches onlypyproject.tomlfails every wheel job at the cibuildwheel test step - after the wheels have already been built.
ogdf-py 0.5.1
Changes since the last Release
Fixed
-
The
drawing_metricsexample indocs/metrics.mdnow shows values measured from the snippet as written, and says they are machine-specific. The generators draw throughstd::uniform_int_distribution, whose algorithm the C++ standard leaves to the implementation, so the same seed builds a different graph under libc++ than under libstdc++ - the drawing is not the only thing that moves between platforms.test_drawing_metrics_example_matches_realityaccordingly checks the key set, the graph size, and the arithmetic between the documented numbers rather than asserting values no other platform can reproduce. -
Tests now seed OGDF's engine before each one (
tests/conftest.py). The engine is process-wide, so a test that generated a random graph without seeding got whatever position the engine was left in by the tests before it - passing underpytest tests/and drawing a different graph underpytest tests/test_x.pyor--lf.
ogdf-py
Changes since the last release
Added
-
Planar layouts:
FPPLayout,PlanarStraightLayout,PlanarDrawLayout, andMixedModelLayout- straight-line and mixed-model planar grid drawings, completing the planar-drawing family alongsideSchnyderLayout. Each validates that the input is a simple planar graph with at least 3 nodes. -
Shortest paths:
a_star_search, point-to-point A* with an optional admissible heuristic; returns the path length and edges, orNoneif the target is unreachable. -
Crossing minimization:
crossing_number(heuristic minimum crossings via the subgraph planarizer) andinsert_edges(routes a chosen set of edges through the otherwise-planar rest of the graph and returns, per edge, the original edges it crosses). -
Flow / cut and connectivity:
min_st_cut(directed or undirected s-t minimum cut, returning the value and the cut edges) andnode_connectivity/edge_connectivity(global and local/Menger k-connectivity). -
Documentation: expanded the coverage checklist with a priority roadmap.
ogdf-py 0.2.0
Python bindings for the Open Graph Drawing Framework (OGDF), built with nanobind.
This is a curated subset of OGDF, not a full wrapper: enough to build graphs, run layout and core graph algorithms, style and draw them, and read/write common graph file formats.
Changes since the last release
Added
-
Layouts:
RadialTreeLayout,LinearLayout(arc diagram),TutteLayout(convex planar),DominanceLayout/VisibilityLayout(upward, for DAGs),MultilevelLayout/ModularMultilevelMixer(large graphs), andBalloonLayout. -
Algorithms: cut vertices (
cut_vertices) and bridges (bridges), Bellman-Ford shortest paths (bellman_ford), minimum-cost flow (min_cost_flow), general maximum-weight matching (maximum_weight_matching, Blossom V), minimum Steiner tree (steiner_tree, Mehlhorn), maximal planar subgraph (maximal_planar_subgraph), and triconnectivity viaseparation_pairandspqr_tree_summary. -
Cross-platform Python bootstrap (
scripts/bootstrap_ogdf.py) replacing the bash script; generalized CMake linking (MSVC-aware); Windows build+test CI job. -
MkDocs documentation site (
docs/) with a coverage checklist and a Gallery page rendering the demo drawings;make docs,make docs-serve,make docs-deploy. -
Demos: gallery entries for the new layouts, and algorithm visualizations for cut vertices/bridges, maximum-weight matching, Bellman-Ford distances, minimum-cost flow, the minimum Steiner tree, and the maximal planar subgraph.
-
Generators: circulant, complete-k-partite, globe, regular-lattice; graph products (cartesian, tensor, strong, lexicographical); operations (union, complement, suspension); and random models (preferential attachment, Chung-Lu, Watts-Strogatz, Waxman, geometric-cube, hierarchy, series-parallel DAG, triconnected, planar-biconnected, planar-triconnected).
-
Predicates and small algorithms:
is_two_edge_connected,is_regular,is_arborescence,triangulate,make_bimodal, andbfs_distances(unweighted single-source distances).
Fixed
-
Removed the persistent CMake
build-dirfrompyproject.toml. Sharing it between editable installs and wheel builds could leave stale objects, so auv build --wheelsometimes omitted recently-added functions. Each build now uses a fresh directory (OGDF is prebuilt, so this stays fast). -
MSVC build: replaced the non-standard
M_PI(undefined on MSVC) with an explicit constant so the extension compiles on Windows.
ogdf-py 0.1.1
Python bindings for the Open Graph Drawing Framework (OGDF), built with nanobind.
This is a curated subset of OGDF, not a full wrapper: enough to build graphs, run layout and core graph algorithms, style and draw them, and read/write common graph file formats.
[0.1.1]
Added
-
OGDF bindings (curated subset):
Graph/Node/Edgewith iteration;NodeArray/EdgeArrayin int/double/bool;GraphAttributeswith coordinates, size, labels, and styling (colors, shapes, fill patterns, stroke, edge arrows, bends). -
Layout algorithms:
SugiyamaLayout,FMMMLayout,GEMLayout,SpringEmbedderKK,StressMinimization,PivotMDS,PlanarizationLayout(with optional orthogonal routing),SchnyderLayout,TreeLayout,CircularLayout. -
Core graph algorithms: connectivity/structure predicates, connected / strong / biconnected components, topological numbering, Dijkstra shortest paths, minimum spanning tree, maximum flow, global minimum cut, matching, node coloring, and planar embedding.
-
Graph generators: complete, complete-bipartite, wheel, cube, grid, Petersen, regular tree, plus random graphs, trees, digraphs, and regular / biconnected / planar variants.
-
File I/O: interchange formats GML, GraphML, DOT, GEXF, GDF, TLP (with extension-based
read/write) and drawing output as SVG and TikZ. -
demos/folder with illustrative scripts (layout gallery, styling showcase, algorithm visualizations, generator zoo, I/O round-trips) writing tobuild/demo-output;make demosalso builds a self-contained HTML gallery (index.html) of every drawing. -
Bindings split into modular translation units (
bind_graph,bind_layouts,bind_algorithms,bind_io,bind_generators). -
Auto-generated
_core.pyitype stub for typed usage and IDE completion. -
cibuildwheelrelease workflow building CPython 3.10-3.13 wheels for Linux (x86_64, aarch64) and macOS (x86_64, arm64) on native runners, bootstrapping OGDF once per platform; trusted-publishing jobs for TestPyPI/PyPI on tags. -
CMake auto-bootstraps OGDF if missing, so
pip installfrom an sdist works without a manual step (Unix only).
Changed
-
Reproducible OGDF dependency:
scripts/bootstrap_ogdf.shshallow-clones OGDF at a pinned tag (foxglove-202510) and builds its static libraries from source; the extension links them.make build/make syncauto-bootstrap if needed. Replaces reliance on a manually placed OGDF checkout. -
Persist the CMake build directory so only the bindings recompile on edits.
Fixed
-
make buildtargeted the wrong package name (ogdfvsogdf-py), making it a silent no-op; it now rebuilds correctly. -
The generic
writenow raisesValueErrorfor attribute-incapable formats (e.g. LEDA, Chaco) instead of crashing the interpreter.
[0.1.0]
Added
-
Initial project structure
-
Core module with example functions
-
Test suite with pytest
-
Build system using scikit-build-core