U
    ª9%e  ã                   @   s  d Z ddlZddlZddlmZ ejddddZ	e
dd„ e	 ¡ D ƒd	d
ZeeƒZejdddZe dd¡Ze edd…dd…f ¡Ze	 e
e e	¡ed	dd ¡ZejeddZejeeedd ejeeedd e d¡ e ¡  e edd…dd…f ¡Zej eddd e d¡ e !d¡ e "d¡ e edd…dd…f ¡Z#e#j$ej%ed	dŽ  e# d ¡ e# "d¡ e# !d!¡ e &¡  e '¡  dS )"aÒ  
===============
Degree Analysis
===============

This example shows several ways to visualize the distribution of the degree of
nodes with two common techniques: a *degree-rank plot* and a
*degree histogram*.

In this example, a random Graph is generated with 100 nodes. The degree of
each node is determined, and a figure is generated showing three things:
1. The subgraph of connected components
2. The degree-rank plot for the Graph, and
3. The degree histogram
é    Néd   g{®Gáz”?i4Lž )Úseedc                 c   s   | ]\}}|V  qd S )N© )Ú.0ÚnÚdr   r   ú{/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/../../../share/doc/networkx-3.1/examples/drawing/plot_degree.pyÚ	<genexpr>   s     r	   T)ÚreversezDegree of a random graph)é   r   )Zfigsizeé   é   é   )Úkeyr
   i¥ž é   )ÚaxZ	node_sizegš™™™™™Ù?)r   ÚalphazConnected components of Gé   zb-Úo)ÚmarkerzDegree Rank PlotZDegreeZRank)Zreturn_countszDegree histogramz
# of Nodes)(Ú__doc__ZnetworkxÚnxÚnumpyÚnpZmatplotlib.pyplotZpyplotZpltZgnp_random_graphÚGÚsortedZdegreeZdegree_sequenceÚmaxZdmaxZfigureZfigZadd_gridspecZaxgridZadd_subplotZax0ZsubgraphZconnected_componentsÚlenZGccZspring_layoutÚposZdraw_networkx_nodesZdraw_networkx_edgesÚ	set_titleZset_axis_offZax1ZplotZ
set_ylabelZ
set_xlabelZax2ÚbarÚuniqueZtight_layoutÚshowr   r   r   r   Ú<module>   s6   






