U
    ‡d¨i  ã                	   @   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
 q€qje	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-xknz3u3n/networkx-3.1.data/data/share/doc/networkx-3.1/examples/drawing/plot_tsp.pyÚ<module>   s6   4ù

