1.1 KiB
| title | aliases | tags | sr-due | sr-interval | sr-ease | ||
|---|---|---|---|---|---|---|---|
| 20-graphs-2 |
|
2022-05-21 | 3 | 250 |
Graph drawing is its own problem.
One easy way is to draw the vertices is clockwise order and draw edges between them
recurisve depth first traversal
same but.. delay the pop of an item from the stack until all its neighbours have been processed, and we only push those one at a time.
topological sorting
In a directed graph we have edges from v to w which do not necessarily imply an edge from w to v.
then is a neighbor of v but not (necessarily) vice versa.
suppose edges indicate some dependency
we want an order of vertices that finishes with v but never containes any vertex unless all the things that depend on it occur earlier
this is a (reverse) topological sort
for this to work the graph must be acyclic. i.e., we cannot have a depends on v which depends on w which depends on a
it that condition is met a recursive depth first traversal can be used.3
