U
    9%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 ]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   bluer   )
edge_colorwidthTred   )Zwith_labelsZedgelistr
   Z	node_sizer   zThe route of the traveller is:)"__doc__Zmatplotlib.pyplotZpyplotZpltZnetworkx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utilspairwiseZ	edge_listZdraw_networkx_edgesZdraw_networkxprintshow r    r    x/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/../../../share/doc/networkx-3.1/examples/drawing/plot_tsp.py<module>   s6   4

