Changelog
View SourceAll notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.4.0] - 2026-09-05
Added
- Added
Zog.Traversalmodule for DAG traversal algorithms:topological_sort/2with:dfs(default) and:kahnalgorithms.acyclic?/1andcyclic?/1for directed cycle detection.
- Added
Zog.ResourceGraph.topological_sort/2,acyclic?/1, andcyclic?/1for native resource-backed graphs. - Added
Zog.HealthMetricsmodule for network health metrics:analyze/1,eccentricity/1,diameter/1,radius/1, andaverage_path_length/1.
- Added
Zog.ResourceGraph.health_metrics/2,eccentricity/2,diameter/1,radius/1, andaverage_path_length/1for native resource-backed graphs. - Added
Zog.Matchingmodule for general graph matching algorithms:- Edmonds' Blossom maximum weight matching (
maximum_weight_matching/2,blossom_maximum_matching/2). - Hungarian (Kuhn-Munkres) minimum weight full bipartite matching (
minimum_weight_full_matching/2,hungarian/2).
- Edmonds' Blossom maximum weight matching (
- Added
Zog.Community.Walktrapmodule andZog.Community.walktrap/2/walktrap_hierarchical/2for native Walktrap community detection with Lance-Williams recurrence updates. - Added HITS (Hyperlink-Induced Topic Search) hubs and authorities centrality algorithm (
hits/2) inZog.Centrality. - Added Yen's $K$-Shortest Paths algorithm (
yen_k_shortest/5) inZog.Pathfinding. - Added Weisfeiler-Leman Graph Hash & Fingerprinting algorithm (
graph_hash/2) inZog.Property. - Added VF2 Graph Isomorphism matching (
isomorphic?/2,find_isomorphism/2) and structural graph predicates (tree?/1,forest?/1,arborescence?/1,arborescence_root/1,branching?/1,complete?/1,regular?/2) inZog.Property. - Added Hierholzer's Eulerian Circuit (
eulerian_circuit/2) & Eulerian Path (eulerian_path/2) detection, along withhas_eulerian_circuit?/1andhas_eulerian_path?/1inZog.Property. - Added native resource-graph wrappers in
Zog.ResourceGraphfor Blossom matching, Hungarian matching, Walktrap community detection, HITS centrality, Yen's K-Shortest paths, Graph Hash, VF2 Isomorphism, Structural Tree Predicates, and Eulerian circuit/path analysis. - Added native Zig implementations in
priv/zog/src/matching.zig,priv/zog/src/community/walktrap.zig,priv/zog/src/traversal.zig,priv/zog/src/health_metrics.zig, andpriv/zog/src/property.zig. - Added benchmarks comparing v0.4.0 algorithms against YogEx:
benchmarks/native_vs_elixir_topological_sort.exsbenchmarks/native_vs_elixir_acyclicity.exsbenchmarks/native_vs_elixir_health_metrics.exsbenchmarks/native_vs_elixir_blossom.exsbenchmarks/native_vs_elixir_hungarian.exsbenchmarks/native_vs_elixir_walktrap.exsbenchmarks/native_vs_elixir_hits.exsbenchmarks/native_vs_elixir_yen.exsbenchmarks/native_vs_elixir_graph_hash.exsbenchmarks/native_vs_elixir_isomorphism.exsbenchmarks/native_vs_elixir_eulerian.exs
Changed
- Updated
ROADMAP.mdandALGORITHMS.mdto mark all v0.4.0 milestone items as implemented. - Added
Zog.TraversalandZog.HealthMetricsto the Algorithms docs group inmix.exs. - Optimized execution performance across core graph algorithms:
- Added
@Vector(4, f64)SIMD vectorization for matrix operations and norm calculations in Walktrap community detection, HITS, PageRank, and centrality linear algebra loops. - Added multi-threaded parallel execution via
std.Threadacross CPU cores for Floyd-Warshall All-Pairs Shortest Path and Brandes Betweenness Centrality. - Configured all NIF modules with
[concurrency: :dirty_cpu]for BEAM scheduler stability during heavy native graph computations.
- Added
[0.3.0] - 2026-06-14
Added
- Added
weakly_connected_components/1toZog.Connectivityandweakly_connected_components/2toZog.ResourceGraph. - Added
anf/2(Approximate Neighborhood Function) toZog.MetricsandZog.ResourceGraphto compute neighborhood sizes and estimate the 90-percentile effective diameter. - Added
kinoas an optional dependency to support future integration. - Added
bipartite_check/1andbipartite_partition/1toZog.Connectivityfor native 2-colorability testing and bipartite partition extraction. - Added
bipartite_check/2andbipartite_partition/2toZog.ResourceGraphfor the same operations on native resource-backed graphs. - Added
maximum_bipartite_matching/1toZog.Connectivityandmaximum_bipartite_matching/2toZog.ResourceGraph, implementing Hopcroft-Karp for maximum cardinality bipartite matching. - Added
ego_graph/3toZog.Transform(delegated viaZog.ego_graph/3) for extracting neighbourhood-induced ego graphs fromSoAbuilders. - Added
ego_graph/3toZog.ResourceGraphfor extracting ego graphs with native resource backing. - Added
transitive_closure/1,transitive_reduction/1, andcontract/3toZog.Transform(delegated viaZog.transitive_closure/1, etc.) for reachability graphs, minimal equivalent DAGs, and node contraction. - Added
transitive_closure/2,transitive_reduction/2, andcontract/4toZog.ResourceGraphfor the same transformations with native resource backing. - Added
subgraph/2toZog.Transform(delegated viaZog.subgraph/2) andsubgraph/3toZog.ResourceGraph(with native Zig NIF backing) for induced subgraph extraction.- Accepts both list and
MapSetinputs for node labels. - Both
SoAbuilder andResourceGraphpaths are covered with unit tests.
- Accepts both list and
Changed
- Replaced the recursive Tarjan SCC implementation with a highly optimized iterative Tarjan implementation, eliminating stack-overflow risk on deep graphs and achieving up to 8-9x speedup over pure Elixir while preserving the same public API and component groupings.
- Optimized
averageClusteringCoefficienton native resource graphs using a degree-ordered forward-triangle based algorithm, achieving optimal O(E^1.5) complexity and avoiding redundant O(sum d(u)^2) neighborhood scans. - Optimized native graph
triangle_countandaverage_clustering_coefficientCSR builders to perform direct SoA/flat slice lookups forArrayGraphand direct list fetches forGraphMap, avoiding hot successors iterator allocation and.next()function call overhead. Halved the cache footprint for clustering coefficient by storingtriangles_per_nodeusingu32instead ofusize. - Optimized
nif_subgraphandnif_node_degreesto use direct SoA/adjacency slice lookups instead of allocating successors iterators, achieving up to 4x speedups on large-scale subgraph extraction. - Optimized undirected edge loading in
nif_read_edgelistby replacing thestd.AutoHashMapbased edge deduplication with an in-place sort and single contiguous scan, reducing load times for the 69M edge LiveJournal graph from 115s to under 12s.
Fixed
- Fixed
Zog.Transform.subgraph/2incorrectly hard-codinginteger_labels: falseon the outputSoA, which causedSoA.all_labels/1andSoA.label_to_id/2to use the wrong code path for integer-labelled graphs (e.g. those loaded viaread_edgelistwith numeric node IDs). - Fixed
Zog.Transform.subgraph/2callingMapSet.new/1even when the caller already passed aMapSet, producing a redundant allocation. - Fixed
ResourceGraph.subgraph/3performing duplicate label-filtering work: thekept_idslist for the NIF is now derived directly from the already-computedsub_builder, eliminating a second full label traversal and guaranteeing the Elixir and native representations stay in sync. - Fixed
ResourceGraph.subgraph/3andResourceGraph.ego_graph/3failing to resolvekept_idscorrectly wheninteger_labelswas enabled, which had caused it to pass contiguous placeholder indices (0..next_id-1) to the NIF instead of the original node IDs. - Fixed
directed: falseloading over-symmetrizing files that already specify symmetric/bidirectional directed lines explicitly (e.g. SNAP undirected files). Dedupes edges by canonical(min, max)pair on loading, avoiding duplicate and redundant edge/self-loop allocations.
Removed
- Removed the deprecated
add_simple_edge/3function (useadd_unweighted_edge/3instead).
[0.2.0] - 2026-06-14
Added
- Added
ALGORITHMS.mdcompatibility matrix comparing Zog implementation status with YogEx. - Added
ROADMAP.mddetailing release milestones up to v0.5.0. - Included small sample of Wiki-Vote graph as a local test fixture (
test/fixtures/wiki_vote.txt) to replace hard-coded machine paths. - Proper docs groupings configuration for all entry points, generators, and algorithm helper modules in
mix.exs.
Changed
- Promoted
ziglerto a required dependency inmix.exs. - Bulk-updated stale
ziglerrecommended versions in NIF error fallback messages from~> 0.15.2to~> 0.16.0. - Renamed all public
is_reachable/3-4functions to follow Elixir idiomatic naming conventions:reachable?/3-4. - Replaced non-portable libc
clock_gettimewith Zig 0.16.0's cross-platformstd.Io.ClockAPI.
Fixed
- Fixed Zig native test suite compilation errors and invalid stack array frees in Tarjan connectivity tests.
- Resolved Dialyzer type-spec failures caused by referencing non-existent
Model.t()type instead ofSoA.t(). - Fixed memory leaks in
UnionFindinitialization on allocation failures in Kruskal's algorithm. - Fixed
ArrayGraph.transposestate corruption where tombstoned nodes inflated thelive_nodescount. - Fixed
edgeCountForNodeinArrayGraphto correctly ignore deleted edges. - Fixed latent
PriorityQueueAPI usage in native pathfinding modules (pq.add->pq.push). - Fixed a Use-After-Free thread safety issue: Thread spawn failures are now handled cleanly by joining already-running threads on error instead of detaching them.
- Fully resolved all
credostyle, alias ordering, and variable rebinding warnings. - Unified repository licenses by copying root Apache-2.0 to
priv/zog/LICENSE. - Fixed missing paths reference to
README.mdinpriv/zog/build.zig.zon.
[0.1.0] - 2026-06-11
Added
- Initial standalone extraction of native Zig NIF-based graph processing layer (
Zog). - Support for
ResourceGraphpattern avoiding copy-in/copy-out NIF serialization overhead. - Direct file parsing (
read_edgelist,read_adjlist,read_tgf) directly to native memory resources. - Bridging functions to/from
Yog(from_graph/1,to_graph/1). - Ported centrality, community, connectivity, flow, metrics, pathfinding, and properties modules.
- Verification and PBT test suite covering all modules.