Thanks, just after writing it occurred to me that it's of course not just a tree.
But I also need it to be ranked by phases, that's where the time-axis comes in.
- the jobs without dependency run in phase 0
- the jobs depending on phase 0 run in phase 1
- and so on
This "rank" requirement (or was it "grade") already includes acyclic, otherwise this wouldn't be possible. I think this is an even narrower requirement than just DAG.
Anyway talking about it helped me sketching my own algorithm already... :)
I searched DAG with graphviz, but couldn't see them ranked in phases and the nodes were all circles (I have practically no hands-on experience with graph-viz)
> automate creating images of them without edges having to cross each other, etc.
Really? I have doubts it's always possible to draw a planar graph.
consider a 3d-cube, how do you want to draw a planar graph without crossings - here x ?
0
/ | \
/ | \
A B C
|\ / \ /|
| x x |
|/ \ / \|
a b c
\ | /
\ | /
1
| [reply] [d/l] [select] |
> automate creating images of them without edges having to cross each other, etc.
Really? I have doubts it's always possible to draw a planar graph.
consider a 3d-cube, how do you want to draw a planar graph without crossings - here x ?
There are two basic cases where the graphs cannot be embedded in a 2-d representation without crossing lines:
- 3 nodes that are each fully connected w/ 3 other nodes
a -> A, B, C
b -> A, B, C
c -> A, B, C
- 5 densely connected nodes
A -> B, C, D, E
B -> C, D, E
C -> D, E
D -> E
All graphs that can't be embedded in a 2-d plane have those cases embedded in them.
Your cube example actually can be embedded. You just lose the pretty perspective (or gain a new one...).
0
/ | \
/ | \
/ B \
/ / \ \
A---a c---C
\ \ / /
\ 1 /
\ | /
\ | /
b
This is proven by Kuratowski's theorem and is discussed here.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
| [reply] [d/l] [select] |
Yes, you are right. I remember discussing K5 and K3,3 in university
> Your cube example actually can be embedded. You just lose the pretty perspective (or gain a new one...).
And this a good example why a good question often matters more than a good answer.
In the context of this task I need the diagram to have a top-down semantic with Y being the time-axis.
So 0 and 1 must be at different extremes, so flattening won't be possible with Q3 °
°) FWIW I remember the notation B3, but all these pandemics in the meantime must have messed with my head :)
| [reply] |
> > automate creating images of them without edges having to cross each other, etc.
> Really? I have doubts it's always possible to draw a planar graph.
You're quite right, that was a brainfart.
| [reply] |