Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nx.Graph CRUD Interface #3

Merged
merged 59 commits into from
May 5, 2024
Merged

nx.Graph CRUD Interface #3

merged 59 commits into from
May 5, 2024

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented May 3, 2024

Introduces 6 new UserDict-based classes:

  • GraphDict --> g.graph
  • NodeDict --> g._node
  • NodeAttrDict --> g._node['node/1']
  • AdjListOuterDict --> g._adj
  • AdjListInnerDict --> g._adj['node/1']
  • EdgeAttrDict --> g._adj['node/1']['node/2']

Each class needs to maintain a responsibility to honor CRUD operations against the DB, all while maintaining the exact same behaviour as the graph, _node, and _adj objects from nx.Graph

Also adds:

  • shortest_path as a server-side algorithm (the first nxadb "custom" algorithm)
  • query() method wrapper (nothing fancy for now)
  • general code cleanup

TODO:

  • fix failing tests
  • add more tests
  • cleanup print statements
  • DiGraph implementation?

There are currently 4 ways to run algorithms with nxadb:

  1. (GPU) Load the entire Graph into memory as nxcg.Graph

  2. (CPU) Load the entire Graph into memory as nx.Graph

  3. (CPU) Load certain parts of the Graph into memory by relying on the underlying UserDict-based dictionaries to "fetch" the data required from ArangoDB. This could imply that the graph may not need to be fully loaded into memory. For example, nx.all_neighbors. The structure remains as a nxadb.Graph.

  4. (N/A) Don't load the Graph at all. Instead, rely on the ArangoDB implementation of Algorithm X. For example, nx.shortest_path. The structure remains as a nxadb.Graph.

@aMahanna aMahanna changed the title wip: CRUD Interface nx.Graph CRUD Interface May 5, 2024
@aMahanna aMahanna merged commit dd5bfe8 into main May 5, 2024
1 check passed
@aMahanna aMahanna deleted the nxadb-crud branch May 5, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant