4 ms·
The most minimal example of it I can think of would be a little ridiculous, but it could look like this: interface Edge { } interface Graph { List<Edge
by dataflow 3y ago
The most minimal example of it I can think of would be a little ridiculous, but it could look like this:
interface Edge { }
interface Graph {
List<Edge> getRoots(); // Returns some ~minimal set of edges with connectivity to all the others
List<Edge> getAdjacentEdges(Edge e, boolean tail);
}
There's no way to directly refer to a vertex here at all (unlike with edges), and yet (since edges have identity) there's enough information to determine the graph structure!
- naasking 3y agoWhat's an example of an algorithm that could use this sort of interface? All of the algorithms that immediately come to mind are more require more vertex information.