U
    h                  	   @   s.  d Z ddlmZ ddlZddlm  mZ	 ddl
Z
ejddddZeedZded< e ZeeeD ]dZeed	 eeD ]LZe
ee d ee d  ee d	 ee d	  ZeZejeeed
 qqje	jedd
ZeejeZejeeddd ejeededddd e de e!  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?   )Zradiusseedpos)      ?r      )weightr   Zbluer   )
edge_colorwidthTZred   )Zwith_labelsZedgelistr	   Z	node_sizer
   zThe route of the traveller is:)"__doc__Zmatplotlib.pyplotZpyplotZpltZnetworkxZnxZ!networkx.algorithms.approximationZ
algorithmsZapproximationZnx_appmathZrandom_geometric_graphGZget_node_attributesr   copyHrangelenijhypotdistZadd_edgeZchristofidescyclelistutilsZpairwiseZ	edge_listZdraw_networkx_edgesZdraw_networkxprintshow r   r   k/tmp/pip-unpacked-wheel-j2te_plx/networkx-3.1.data/data/share/doc/networkx-3.1/examples/drawing/plot_tsp.py<module>   s6   4

