""" Provides a solution (`solve`) to the EMST problem. """

# Euclidean Minimum Spanning Tree (MST) algorithm
#
# input: a list of n Point objects
#
# output: a list of (p, q) tuples, where p and q are each input Point
# objects, and (p, q) should be connected in a minimum spanning tree
# of the input points
def solve(points):
    """ Solves the EMST problem """
    if not isinstance(points, list):
        raise TypeError("solve expects a list of n Point objects, received %s" % points)

    plen = len(points)
    if plen < 2:
        return []

    if plen == 2:
        return [(points[0], points[1])]

""" Provides a solution (`solve`) to the EMST problem. """

from .graph import Graph

# Euclidean Minimum Spanning Tree (MST) algorithm
#
# input: a list of n Point objects
#
# output: a list of (p, q) tuples, where p and q are each input Point
# objects, and (p, q) should be connected in a minimum spanning tree
# of the input points
def solve(points):
    """ Solves the EMST problem """
    # it's not a list
    if not isinstance(points, list):
        raise TypeError("solve expects a list of n Point objects, received %s" % points)

    g = Graph(points)

    if g.num_edges() < 1:
        return []

    return []

Use (still wrong) Graph implementation in MST.py
Use (still wrong) Graph implementation in MST.py

  """ Provides a solution (`solve`) to the EMST problem. """
+ 
+ from .graph import Graph
  
  # Euclidean Minimum Spanning Tree (MST) algorithm
  #
  # input: a list of n Point objects
  #
  # output: a list of (p, q) tuples, where p and q are each input Point
  # objects, and (p, q) should be connected in a minimum spanning tree
  # of the input points
  def solve(points):
      """ Solves the EMST problem """
+     # it's not a list
      if not isinstance(points, list):
          raise TypeError("solve expects a list of n Point objects, received %s" % points)
  
-     plen = len(points)
-     if plen < 2:
+     g = Graph(points)
+ 
+     if g.num_edges() < 1:
          return []
  
+     return []
-     if plen == 2:
-         return [(points[0], points[1])]
  
Use (still wrong) Graph implementation in MST.py
## Code Before:
""" Provides a solution (`solve`) to the EMST problem. """

# Euclidean Minimum Spanning Tree (MST) algorithm
#
# input: a list of n Point objects
#
# output: a list of (p, q) tuples, where p and q are each input Point
# objects, and (p, q) should be connected in a minimum spanning tree
# of the input points
def solve(points):
    """ Solves the EMST problem """
    if not isinstance(points, list):
        raise TypeError("solve expects a list of n Point objects, received %s" % points)

    plen = len(points)
    if plen < 2:
        return []

    if plen == 2:
        return [(points[0], points[1])]

## Instruction:
Use (still wrong) Graph implementation in MST.py
## Code After:
""" Provides a solution (`solve`) to the EMST problem. """

from .graph import Graph

# Euclidean Minimum Spanning Tree (MST) algorithm
#
# input: a list of n Point objects
#
# output: a list of (p, q) tuples, where p and q are each input Point
# objects, and (p, q) should be connected in a minimum spanning tree
# of the input points
def solve(points):
    """ Solves the EMST problem """
    # it's not a list
    if not isinstance(points, list):
        raise TypeError("solve expects a list of n Point objects, received %s" % points)

    g = Graph(points)

    if g.num_edges() < 1:
        return []

    return []
