def route_through_array(array, start, end, fully_connected=True, geometric=True):
 (start, end) = (tuple(start), tuple(end))
 if geometric:
  mcp_class = MCP_Geometric
 else:
  mcp_class = MCP
 m = mcp_class(array, fully_connected=fully_connected)
 (costs, traceback_array) = m.find_costs([start], [end])
 return (m.traceback(end), costs[end])

def route_through_array ( array , start , end , fully_connected = True , geometric = True ) : ( start , end ) = ( tuple ( start ) , tuple ( end ) ) if geometric : mcp_class = MCP_Geometric else : mcp_class = MCP m = mcp_class ( array , fully_connected = fully_connected ) ( costs , traceback_array ) = m . find_costs ( [ start ] , [ end ] ) return ( m . traceback ( end ) , costs [ end ] )
simple example of how to use the mcp and mcp_geometric classes .