Prim's algorithm for MST

Sign in to test your solution.
def Prim(graaf:dict): """ >>> Prim({'u':[(1,'v'),(2,'w'),(3,'x'),(5,'y')], 'v':[(1,'u'),(2,'w'),(4,'x'),(5,'y')], 'w':[(2,'u'),(2,'v'),(6,'x')], 'x':[(3,'u'), (6,'w'),(4,'v'),(2,'y')], 'y':[(5,'u'),(2,'x'),(5,'v')]}) {'u': ['v', 'w', 'x'], 'v': ['u'], 'w': ['u'], 'x': ['u', 'y'], 'y': ['x']} """ #TODO

  Python sandbox

This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.

Test case being debugged