hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

Marc Trius

Is there a term for a graph that changes shape as it is traversed? (You could say that an edge is or isn't enabled depending on which edge was used to enter the node)

@UP8
Good question. This would be a property of each graph or node.

So a couple of scenarios:

Traversing a node enables an edge anywhere in the graph, permanently or until some other event disables it

An edge to a node follows the agent, always being available at the current node, until traversed or disabled

Some edges are directional, some aren't, some nodes can only be visited once and some can be visited N or unlimited times

@alter_kaker @UP8 I've had to do with mutable graphs in a different context (code generation from a graph based intermediate representation, matching subgraph patterns and rewriting them in the while, usually emitting instructions as side effect of the match/replace step). I've not seen a special name for the graph data structure.

@alter_kaker @UP8 Though there was a twist because one would not greedily match, replace, emit instructions, but search for a good or optimal sequence. So there was a second graph (DAG) representing the different possible sequences, generated as needed and used to search the optimal or a near optimal solution.

@alter_kaker @UP8 (And the matches were generated from a special description language)

@project1enigma that's kind of what I was thinking about doing, or possibly copying nodes as needed into a temporary subset of the graph @UP8

@alter_kaker @project1enigma giving the data structure a name only makes sense once you know what the data structure is, but if it is a graph that gets changed by a program I might say it is a "dynamic graph"; if you can make the program simple and put the complexity into a fixed data structure that would be all the better

@UP8 @alter_kaker If you don't need to explore different possible changes, you can modify things in place. You need more complex things like persistent data structures or purely functional ones or undo stacks or similar only if you do things like the search for an optimum modification sequence I described.

@UP8 @alter_kaker In my case, the actual intermediate representation graph was IIRC never really changed. Just the solution search graph was built and the nodes/edges of that had enough information to know, together with the original IR, how to try potential next matches.

@UP8
The reason I am looking for a name is to see what I can find about how other people work with it 🙂
@project1enigma

@UP8
For example, finding paths, like what
@project1enigma was describing

@alter_kaker @UP8 I'm still not sure if you need backtracking/undo.

Or if you just have your graph and some "player"/agent/cursor walking through it while each step can possibly enable/disable some edge or node elsewhere (but no undo)?

@alter_kaker @UP8 The latter case should be easier. Like if it's just enabling/disabling edges/nodes I might just add a bool enabled everywhere and respect it in the code that moves the cursor/agent around.

@project1enigma
Right, but I also want my agent to be able to plan, so I need a pathfinding algorithm that takes into account the graph changes
@UP8

@alter_kaker @UP8 Ah yeah. A general term would be persistent data structure, IIRC.

Another thing would be zippers (in the context of pure functional programming though zippers are usually for local modifications).

@alter_kaker @UP8 Alternatively you do modify things in place but have undo information on your stack.

@wlukewindsor
It is! Thanks. Now let's see if I can even read this with my brain

@alter_kaker not my field but I was adjacent during my postdoc…