Skip to content

Conversation

@mtfishman
Copy link
Member

@mtfishman mtfishman commented Jan 20, 2023

This PR adds:

  • is_path_graph for checking if a graph is a path/linear graph.
  • Fixes degree, indegree, outdegree for integer vertex names.
  • Introduces a Key object for unambiguous indexing of arrays, dictionaries, etc. This will help when dealing with general keys of dictionaries and vertices of NamedGraphs in nested data structures, where if the keys/vertex names are vectors it can be ambiguous whether they refer to a data structure or a key/vertex. The particular application is binary tree contraction sequences in ITensorNetworks.jl like [[1, 2], 3] which can become ambiguous if the vertex names are vectors [1, 2], [3, 4], [5, 6], i.e. [[[1, 2], [3, 4]], [5, 6]]. Using the Key wrapper that sequence can be represented as [[Key([1, 2]), Key([3, 4])], Key([5, 6])]. @JoeyT1994

@mtfishman mtfishman merged commit 4dcbda7 into main Jan 20, 2023
@mtfishman mtfishman deleted the is_path_graph branch January 20, 2023 22:51
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.

2 participants