o
    ˷e                  	   @   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 ]2Zeed	 eeD ]&Ze
ee d ee d  ee d	 ee d	  ZeZejeeed
 q@q5e	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?   )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 r3   r3   r/var/www/ideatree/venv/lib/python3.10/site-packages/../../../share/doc/networkx-2.8.6/examples/drawing/plot_tsp.py<module>   s:    4

