4

!rant
Uni homework...

How can I decide if a weighted, undirected graph is connected or not, using Kruskal's algorithm?

Comments
  • 1
    It seems you need to run Kruskal's algorithm and afterwards check if all nodes are in the resulting minimal spanning tree.

    At least that's what I think after looking at the Wikipedia article about the algorithm.
  • 1
    The problem is - I am a total n00b in graphs. I've never quite got the hang of them...
  • 2
    It's not as complicated as it might seem in the beginning and in some explanations.
    Graphs are collections of nodes that can be connected with edges. Weighted graphs have a number associated with every edge.

    That's pretty much all there is to it.
    Then you need to store the nodes and the edges in fitting data structures.
  • 1
  • 0
    Thank you guys for the answers - I managed to implement the algorithm in C++. 😃
Add Comment