
    Gd              	          d Z ddlmZ ddlZddlmc mZ	 ddl
Z
 ej        ddd          Z ej        ed          Zded<   e                                Z e ee                    D ]~Z eed	z    ee                    D ]cZ e
j        ee         d         ee         d         z
  ee         d	         ee         d	         z
            ZeZe                    eee
           d e	j        ed
          Z eej                            e                    Z ej        eedd            ej        eededdd            e de            ej!                     dS )ac  
==========================
Traveling Salesman Problem
==========================

This is an example of a drawing solution of the traveling salesman problem

The function is used to produce the solution is christofides,
where given a set of nodes, it calculates the route of the nodes
that the traveler has to follow in order to minimize the total cost.
    N   g?   )radiusseedpos)      ?r      )weightr
   bluer   )
edge_colorwidthTred   )with_labelsedgelistr   	node_sizer   zThe route of the traveller is:)"__doc__matplotlib.pyplotpyplotpltnetworkxnx!networkx.algorithms.approximation
algorithmsapproximationnx_appmathrandom_geometric_graphGget_node_attributesr   copyHrangelenijhypotdistadd_edgechristofidescyclelistutilspairwise	edge_listdraw_networkx_edgesdraw_networkxprintshow     3share/doc/networkx-3.1/examples/drawing/plot_tsp.py<module>r7      s  
 
            2 2 2 2 2 2 2 2 2 Bb1555bQ&& 
AFFHH 
ss3xx & &AU1q5##c((## & &tz#a&)c!fQi/QSVAY1FGG	

1a
%%%%&
 	Ah///D""5))**	  q#& < < < <  
    & . . . 




r5   