mirror of
https://github.com/mfocko/blog.git
synced 2025-05-08 04:12:59 +02:00
chore(svg): generate light/dark mode DOTs
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
701ad8236a
commit
52b3ccdf83
4 changed files with 18 additions and 8 deletions
ib002/10-graphs
|
@ -18,11 +18,11 @@ As we have talked on the seminar, if we construct from some vertex $u$ BFS tree
|
|||
|
||||
Consider the following graph:
|
||||
|
||||

|
||||

|
||||
|
||||
We run BFS from the vertex $a$ and obtain the following BFS tree:
|
||||
|
||||

|
||||

|
||||
|
||||
Let's consider pair of vertices $e$ and $h$. For them we can safely lay, from the BFS tree, following properties:
|
||||
|
||||
|
@ -37,7 +37,7 @@ Let's keep the same graph, but break the lower bound, i.e. I have gotten a lower
|
|||
|
||||
Now the more important question, is there a shorter path in that graph? The answer is no, there's no shorter path than the one with length $2$. So what can we do about it? We'll add an edge to have a shorter path. Now we have gotten a lower bound of $2$, which means the only shorter path we can construct has $1$ edge and that is ‹$e, h$› (no intermediary vertices). Let's do this!
|
||||
|
||||

|
||||

|
||||
|
||||
Okay, so we have a graph that breaks the rule we have laid. However, we need to run BFS to obtain the new BFS tree, since we have changed the graph.
|
||||
|
||||
|
@ -49,7 +49,7 @@ Do we need to run BFS after **every** change?
|
|||
|
||||
:::
|
||||
|
||||

|
||||

|
||||
|
||||
Oops, we have gotten a new BFS tree, that has a height difference of 1.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue