Graph-Search: Added initial files
This commit is contained in:
BIN
Graph-Search/assets/graph.png
Normal file
BIN
Graph-Search/assets/graph.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
55
Graph-Search/class-activity.md
Normal file
55
Graph-Search/class-activity.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Class Activity: Exploring MST Characteristics
|
||||||
|
|
||||||
|
We will be exploring creating graphs that showcase different aspects of MST
|
||||||
|
algorithms.
|
||||||
|
|
||||||
|
## Task 1:
|
||||||
|
|
||||||
|
True/False. A MST can sometimes contain a cycle. Justify your answer with one or
|
||||||
|
two sentences.
|
||||||
|
|
||||||
|
> Answer: False. By definition you can remove an edge from cycle and all
|
||||||
|
> vertices will still be connected. Therefor if the MST has a cycle in it then
|
||||||
|
> that would mean it has a redundant edge and is therefore not minimal.
|
||||||
|
|
||||||
|
## Task 2:
|
||||||
|
|
||||||
|
For the following graph, show the safe data structure after one call to
|
||||||
|
Borůvka's `AddAllSafeEdges` method. Draw the spanning tree F showing all of the
|
||||||
|
safe edges that were added to it after this first pass.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Task 3:
|
||||||
|
|
||||||
|
Create a graph with at least 6 nodes that is fully connected (a complete graph)
|
||||||
|
and has distinct edge weights that Boruvka's algorithm can solve in a single
|
||||||
|
call to `AddAllSafeEdges`. Submit a picture of the graph and the safe array/list
|
||||||
|
that is created by the call to `AddAllSafeEdges`.
|
||||||
|
|
||||||
|
## Task 4:
|
||||||
|
|
||||||
|
Create a graph with at least 6 vertices with distinct edge weights such that the
|
||||||
|
MST contains the edge with the largest weight. Submit a picture of this graph.
|
||||||
|
|
||||||
|
## Task 5:
|
||||||
|
|
||||||
|
Create a graph with at least 4 nodes that is fully connected (a complete graph)
|
||||||
|
and has distinct edge weights that Boruvka's algorithm exhibits its worst case
|
||||||
|
performance. First, define what the worst case perform is for a single call to
|
||||||
|
`AddAllSafeEdges`. Next, showcase this performance on your graph clearly showing
|
||||||
|
how the MST (F) looks after a single call to `AddAllSafeEdges` and showing the
|
||||||
|
contents of the array/list **safe**.
|
||||||
|
|
||||||
|
## Task 6:
|
||||||
|
|
||||||
|
Can you create a graph with at least 4 vertices with distinct edge weights such
|
||||||
|
that the MST does not contain the lightest edge? Explain your answer both
|
||||||
|
logically (1 to 2 sentences) and using the logic within Boruvka's
|
||||||
|
`AddAllSafeEdges`.
|
||||||
|
|
||||||
|
## Submission
|
||||||
|
|
||||||
|
Submit a picture of your answers to this canvas assignment. If you worked with
|
||||||
|
another person, acknowledge that by placing the names of all people you worked
|
||||||
|
with at the top of the first page of your submission.
|
||||||
Reference in New Issue
Block a user