def prims_algorithm(self) -> Graph:
        subgraph: Graph = Graph({min(self.vertices)}, {})
        min_edge: EdgeT
        min_weight: int
        edge: EdgeT
        weight: int

        while len(subgraph.vertices) < len(self.vertices):
            min_weight = max(self.edges.values()) + 1
            for edge, weight in self.edges.items():
                if (edge[0] in subgraph.vertices) ^ (edge[1] in subgraph.vertices):
                    if weight < min_weight:
                        min_edge = edge
                        min_weight = weight

            subgraph.add_edge(min_edge, min_weight)

        return subgraph