Catalog PyPI
PACKAGE EXPLORERView in registry

adaptive-graph-engine

PyPI

A Python graph engine for dependency modelling, path discovery, graph traversal and relationship-aware analysis.

Versions collected1
Direct dependencies0From release 0.3.0
Last observed20 Oct, 19:06 UTC

README

Version 0.3.0 documentation

Adaptive Graph Engine

Adaptive Graph Engine is a Python graph engine for modelling and analysing directed dependency networks. It provides path discovery, BFS/DFS traversal, weighted shortest paths, cycle detection, topological ordering, structural graph analysis, persistence, and change tracking across evolving graph states.

Features

  • Directed graph representation
  • Nodes and edges
  • Parallel edges
  • Edge weights
  • Node metadata
  • Relationship metadata
  • Neighbour lookup
  • Predecessor and successor lookup
  • Node and edge counts
  • In-degree, out-degree and total degree
  • Breadth-First Search (BFS)
  • Depth-First Search (DFS)
  • Dijkstra shortest weighted path
  • Directed cycle detection
  • Topological sorting
  • Connected components
  • Local neighbourhood analysis
  • Dictionary serialization and restoration
  • JSON save and load
  • Graph state comparison
  • Node and edge change detection
  • Edge weight change detection

Installation

pip install adaptive-graph-engine

Basic Usage

from adaptive_graph_engine import Graph

graph = Graph()

graph.add_edge(
    "salesforce",
    "customer_raw",
    metadata={"relationship": "INGESTS_TO"}
)

graph.add_edge(
    "customer_raw",
    "customer_clean",
    metadata={"relationship": "TRANSFORMS_TO"}
)

print(graph.get_neighbors("salesforce"))

Output:

['customer_raw']

Graph Algorithms

Algorithms are available from adaptive_graph_engine.algorithms.

Find a path with the fewest hops.

from adaptive_graph_engine.algorithms import find_shortest_path

path = find_shortest_path(
    graph,
    "salesforce",
    "customer_clean"
)

Explore a graph using depth-first traversal.

from adaptive_graph_engine.algorithms import find_depth_first

path = find_depth_first(
    graph,
    "salesforce",
    "customer_clean"
)

Dijkstra

Find the lowest-cost path using edge weights.

from adaptive_graph_engine.algorithms import dijkstra

result = dijkstra(
    graph,
    "salesforce",
    "customer_clean"
)

Dijkstra returns the path and its total cost.

Cycle Detection

from adaptive_graph_engine.algorithms import has_cycle

contains_cycle = has_cycle(graph)

Topological Sort

from adaptive_graph_engine.algorithms import topological_sort

order = topological_sort(graph)

Topological sorting returns None when the directed graph contains a cycle.

Connected Components

Find groups of connected nodes. Direction is ignored when determining component membership.

from adaptive_graph_engine.algorithms import get_connected_components

components = get_connected_components(graph)

Local Neighbourhood

Inspect the graph surrounding a node up to a specified depth.

from adaptive_graph_engine.algorithms import get_neighborhood

neighborhood = get_neighborhood(
    graph,
    "customer_raw",
    depth=2
)

Graph Statistics

The graph provides basic structural measurements.

graph.number_of_nodes()
graph.number_of_edges()

graph.in_degree("customer_raw")
graph.out_degree("customer_raw")
graph.degree("customer_raw")

Parallel edges are counted separately.

Graph Persistence

Graphs can be converted to dictionaries and reconstructed later.

data = graph.to_dictionary()

restored_graph = Graph.from_dictionary(data)

Graph state can also be saved to and loaded from JSON.

from adaptive_graph_engine.io import save_json, load_json

save_json(
    graph,
    "graph.json"
)

restored_graph = load_json(
    "graph.json"
)

Serialization preserves node metadata, edge weights, relationship metadata and parallel edges.

Graph Change Tracking

Adaptive Graph Engine can compare two graph states and report structural changes.

from adaptive_graph_engine import Graph
from adaptive_graph_engine.changes import compare_graphs

old_graph = Graph()

old_graph.add_edge(
    "customer_clean",
    "revenue_model",
    weight=2,
    metadata={
        "relationship": "FEEDS"
    }
)

new_graph = Graph()

new_graph.add_edge(
    "customer_clean",
    "revenue_model",
    weight=8,
    metadata={
        "relationship": "FEEDS"
    }
)

changes = compare_graphs(
    old_graph,
    new_graph
)

print(changes)

Graph comparison can detect:

  • Nodes added
  • Nodes removed
  • Edges added
  • Edges removed
  • Edge weight changes
  • Changes across parallel relationships

Change tracking provides a foundation for systems that need to observe how dependency and relationship structures evolve over time.

Example Use Cases

Adaptive Graph Engine can be used as a foundation for:

  • Dependency graphs
  • Data lineage
  • Provenance graphs
  • Workflow dependencies
  • Knowledge graph infrastructure
  • Relationship-aware systems
  • Graph change monitoring
  • Evolving dependency networks

Requirements

Python 3.11 or later.

Version

Current release: 0.3.0

Author

Yassine Chaachaa

License

MIT

Downloads & popularity

8downloads
1-day window · source-reported counts19 Oct 2026
14974.50
2026-09-24: 149 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-24–2026-09-242026-09-25: 110 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-25–2026-09-252026-09-26: 15 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-26–2026-09-262026-09-27: 11 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-28–2026-09-282026-09-29: 6 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-29–2026-09-292026-09-30: 5 · observed 2026-10-20T21:36:36.5866213Z · period 2026-09-30–2026-09-302026-10-01: 4 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-01–2026-10-012026-10-03: 1 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-03–2026-10-032026-10-04: 9 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-04–2026-10-042026-10-05: 8 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-05–2026-10-052026-10-06: 3 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-06–2026-10-062026-10-07: 1 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-07–2026-10-072026-10-08: 2 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-08–2026-10-082026-10-09: 6 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-09–2026-10-092026-10-10: 3 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-10–2026-10-102026-10-11: 7 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-11–2026-10-112026-10-12: 2 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-12–2026-10-122026-10-13: 1 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-13–2026-10-132026-10-14: 7 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-14–2026-10-142026-10-15: 1 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-15–2026-10-152026-10-18: 2 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-18–2026-10-182026-10-19: 8 · observed 2026-10-20T21:36:36.5866213Z · period 2026-10-19–2026-10-19
24 Sept19 Oct

pypistats · 23 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1982026-10-20T21:36:36.5866213Z
2026-10-18 – 2026-10-1822026-10-20T21:36:36.5866213Z
2026-10-15 – 2026-10-1512026-10-20T21:36:36.5866213Z
2026-10-14 – 2026-10-1472026-10-20T21:36:36.5866213Z
2026-10-13 – 2026-10-1312026-10-20T21:36:36.5866213Z
2026-10-12 – 2026-10-1222026-10-20T21:36:36.5866213Z
2026-10-11 – 2026-10-1172026-10-20T21:36:36.5866213Z
2026-10-10 – 2026-10-1032026-10-20T21:36:36.5866213Z
2026-10-09 – 2026-10-0962026-10-20T21:36:36.5866213Z
2026-10-08 – 2026-10-0822026-10-20T21:36:36.5866213Z
2026-10-07 – 2026-10-0712026-10-20T21:36:36.5866213Z
2026-10-06 – 2026-10-0632026-10-20T21:36:36.5866213Z
2026-10-05 – 2026-10-0582026-10-20T21:36:36.5866213Z
2026-10-04 – 2026-10-0492026-10-20T21:36:36.5866213Z
2026-10-03 – 2026-10-0312026-10-20T21:36:36.5866213Z
2026-10-01 – 2026-10-0142026-10-20T21:36:36.5866213Z
2026-09-30 – 2026-09-3052026-10-20T21:36:36.5866213Z
2026-09-29 – 2026-09-2962026-10-20T21:36:36.5866213Z
2026-09-28 – 2026-09-2822026-10-20T21:36:36.5866213Z
2026-09-27 – 2026-09-27112026-10-20T21:36:36.5866213Z
2026-09-26 – 2026-09-26152026-10-20T21:36:36.5866213Z
2026-09-25 – 2026-09-251102026-10-20T21:36:36.5866213Z
2026-09-24 – 2026-09-241492026-10-20T21:36:36.5866213Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.025 Sept 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:06 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:24ccb0aa276aece19fde639451bbfa6e044e7e2c8202c0e522ee2e490664a637