Observed since 20 Oct, 19:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
adaptive-graph-engine
A Python graph engine for dependency modelling, path discovery, graph traversal and relationship-aware analysis.
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.
pip install adaptive-graph-engine
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']
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"
)
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.
from adaptive_graph_engine.algorithms import has_cycle
contains_cycle = has_cycle(graph)
from adaptive_graph_engine.algorithms import topological_sort
order = topological_sort(graph)
Topological sorting returns None when the directed graph contains a cycle.
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)
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
)
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.
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.
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:
Change tracking provides a foundation for systems that need to observe how dependency and relationship structures evolve over time.
Adaptive Graph Engine can be used as a foundation for:
Python 3.11 or later.
Current release: 0.3.0
Yassine Chaachaa
MIT
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
bdist_wheel · 11.39 KB · Python py3
sdist · 12.52 KB · Python source
Observed since 20 Oct, 19:06 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:10cc5d4c7235ba5b7e67c11c4fc4e2872e1f6d77ee7edd7b3078824d21836a23