hyb
2026-01-30 7657e1b2fa251a2ea372710ad75cb395a3c0e374
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
Ë
?ñúh4Qãó6—dZddlmZddlmZGd„de«Zy)zÜ
altgraph.Graph - Base Graph class
=================================
 
..
  #--Version 2.1
  #--Bob Ippolito October, 2004
 
  #--Version 2.0
  #--Istvan Albert June, 2004
 
  #--Version 1.0
  #--Nathan Denny, May 27, 1999
é)Údeque)Ú
GraphErrorcón—eZdZdZd9d„Zd„Zd9d„Zd:d„Zd„Zd„Z    d    „Z
d
„Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z!d!„Z"d"„Z#d#„Z$d$„Z%d%„Z&d&„Z'd'„Z(d(„Z)d;d)„Z*d*„Z+d+„Z,d;d,„Z-d-„Z.d.„Z/d<d/„Z0d=d0„Z1d<d1„Z2d9d2„Z3d9d3„Z4d9d4„Z5d9d5„Z6d6„Z7d7„Z8d<d8„Z9y)>ÚGrapha¼
    The Graph class represents a directed graph with *N* nodes and *E* edges.
 
    Naming conventions:
 
    - the prefixes such as *out*, *inc* and *all* will refer to methods
      that operate on the outgoing, incoming or all edges of that node.
 
      For example: :py:meth:`inc_degree` will refer to the degree of the node
      computed over the incoming edges (the number of neighbours linking to
      the node).
 
    - the prefixes such as *forw* and *back* will refer to the
      orientation of the edges used in the method with respect to the node.
 
      For example: :py:meth:`forw_bfs` will start at the node then use the
      outgoing edges to traverse the graph (goes forward).
    Ncó—d|_iic|_|_iic|_|_|c|D]]}t |«dk(r|\}}|j ||«Œ)t |«dk(r|\}}}|j |||«ŒQtd|›«‚yy)z 
        Initialization
        rNéézCannot create edge from )Ú    next_edgeÚnodesÚedgesÚ hidden_edgesÚ hidden_nodesÚlenÚadd_edger)Úselfr ÚitemÚheadÚtailÚdatas      úAH:\Change_password\venv_build\Lib\site-packages\altgraph/Graph.pyÚ__init__zGraph.__init__)s €ð
ˆŒØ!# RЈŒ
D”JØ/1°2Ð,ˆÔ˜4Ô,à Ð Øò MÜt“9 ’>Ø!%‘JD˜$Ø—M‘M $¨Õ-ܘ“Y !’^Ø'+Ñ$D˜$ Ø—M‘M $¨¨dÕ3å$ÁTÐ%KÓLÐLñ Mð ócóH—d|j«|j«fzS)Nz<Graph: %d nodes, %d edges>)Únumber_of_nodesÚnumber_of_edges©rs rÚ__repr__zGraph.__repr__=s,€Ø,Ø ×  Ñ  Ó "Ø ×  Ñ  Ó "ð0
ñ
ð    
rcód—||jvry||jvrgg|f|j|<yy)zê
        Adds a new node to the graph.  Arbitrary data can be attached to the
        node via the node_data parameter.  Adding the same node twice will be
        silently ignored.
 
        The node must be a hashable value.
        N)rr )rÚnodeÚ    node_datas   rÚadd_nodezGraph.add_nodeCs;€ð 4×$Ñ$Ñ $à à t—z‘zÑ !Ø " B¨    Ð2ˆDJ‰JtÒ ð "rcót—|j}|r"|j|«|j|«    |j|dj|«|j|dj|«|||f|j |<|xjdz c_y#t$rt d|›d|›«‚wxYw)aÈ
        Adds a directed edge going from head_id to tail_id.
        Arbitrary data can be attached to the edge via edge_data.
        It may create the nodes if adding edges between nonexisting ones.
 
        :param head_id: head node
        :param tail_id: tail node
        :param edge_data: (optional) data attached to the edge
        :param create_nodes: (optional) creates the head_id or tail_id
            node in case they did not exist
        rézInvalid nodes z -> N)r
r!r ÚappendÚKeyErrorrr )rÚhead_idÚtail_idÚ    edge_dataÚ create_nodesÚedges      rrzGraph.add_edgeYs°€ð~‰~ˆñ Ø M‰M˜'Ô "Ø M‰M˜'Ô "ð     LØ J‰JwÑ  Ñ "× )Ñ )¨$Ô /Ø J‰JwÑ  Ñ "× )Ñ )¨$Ô /ð
$ W¨iÐ8ˆ
‰
4Ñà Š˜!ÑŽøô ò    LݺÁ'ÐJÓKÐ Kð    Lús ²ABÂB7có—    |j|x\}}}|j|<|j|dj|«|j|dj|«|j|=y#t$rt d|z«‚wxYw)zd
        Hides an edge from the graph. The edge may be unhidden at some later
        time.
        rr#úInvalid edge %sN)r r r Úremover%r)rr*r&r'r(s     rÚ    hide_edgezGraph.hide_edge|s€ð
    7ØDHÇJÁJÈtÑDTÐ TÑ 'ˆGW˜i¨$×*;Ñ*;¸DÑ*AØ J‰JwÑ  Ñ "× )Ñ )¨$Ô /Ø J‰JwÑ  Ñ "× )Ñ )¨$Ô /Ø—
‘
˜4Ñ øÜò    7ÜÐ.°Ñ5Ó6Ð 6ð    7ús ‚A1A4Á4B có䗠   |j|«}|j||f|j|<|D]}|j|«Œ|j|=y#t$rt d|z«‚wxYw)z¦
        Hides a node from the graph.  The incoming and outgoing edges of the
        node will also be hidden.  The node may be unhidden at some later time.
        úInvalid node %sN)Ú    all_edgesr rr.r%r©rrr1r*s    rÚ    hide_nodezGraph.hide_node‰sz€ð
    7ØŸ™ tÓ,ˆIØ'+§z¡z°$Ñ'7¸Ð&CˆD× Ñ ˜dÑ #Ø!ò %Ø—‘˜tÕ$ð %à—
‘
˜4Ñ øÜò    7ÜÐ.°Ñ5Ó6Ð 6ð    7ús ‚AAÁA/cóė    |j|\|j|<}|D]}|j|«Œ|j|=y#t$rt    d|z«‚wxYw)z„
        Restores a previously hidden node back into the graph and restores
        all of its incoming and outgoing edges.
        r0N)rr Ú restore_edger%rr2s    rÚ restore_nodezGraph.restore_node—sp€ð
    7Ø*.×*;Ñ*;¸DÑ*AÑ 'ˆDJ‰JtÑ ˜iØ!ò (Ø×!Ñ! $Õ'ð (à×!Ñ! $Ñ'øÜò    7ÜÐ.°Ñ5Ó6Ð 6ð    7ús ‚AAÁAcó$—    |j|\}}}|j|dj|«|j|dj|«|||f|j|<|j|=y#t$rt d|z«‚wxYw)zH
        Restores a previously hidden edge back into the graph.
        rr#r,N)r r r$r r%r)rr*r&r'rs     rr5zGraph.restore_edge¤s™€ð    7Ø%)×%6Ñ%6°tÑ%<Ñ "ˆGW˜dØ J‰JwÑ  Ñ "× )Ñ )¨$Ô /Ø J‰JwÑ  Ñ "× )Ñ )¨$Ô /Ø&¨°Ð5ˆDJ‰JtÑ Ø×!Ñ! $Ñ'øÜò    7ÜÐ.°Ñ5Ó6Ð 6ð    7ús ‚A4A7Á7Bcó–—t|jj««D]}    |j|«Œy#t$rYŒ#wxYw)z,
        Restores all hidden edges.
        N)Úlistr Úkeysr5r©rr*s  rÚrestore_all_edgeszGraph.restore_all_edges±sN€ô˜×*Ñ*×/Ñ/Ó1Ó2ò    ˆDð Ø×!Ñ! $Õ'ñ    øôò Ùð ús¨<¼    AÁAcóv—t|jj««D]}|j|«Œy)z,
        Restores all hidden nodes.
        N)r9rr:r6©rrs  rÚrestore_all_nodeszGraph.restore_all_nodes»s5€ô˜×*Ñ*×/Ñ/Ó1Ó2ò    $ˆDØ × Ñ ˜dÕ #ñ    $rcó—||jvS)z5
        Test whether a node is in the graph
        ©r r>s  rÚ __contains__zGraph.__contains__Âs€ðt—z‘zÐ!Ð!rcór—    |j|\}}}||fS#t$rd\}}td|z«‚wxYw)úN
        Returns the edge that connects the head_id and tail_id nodes
        )NNr,)r r%r©rr*rrrs     rÚ
edge_by_idzGraph.edge_by_idÈsS€ð    7Ø#Ÿz™z¨$Ñ/Ñ ˆD$˜ð
dˆ|Ðøô    ò    7Ø#‰JˆD$ÜÐ.°Ñ5Ó6Ð 6ð    7ús‚™6có`—|j|«D]}|j|«|k(sŒ|cSy)rDN©Ú    out_edgesr)rrrr*s    rÚ edge_by_nodezGraph.edge_by_nodeÔs6€ð—N‘N 4Ó(ò    ˆD؏y‰y˜‹ $Ó&Ø’ ð    ðrcó,—t|j«S)z-
        Returns the number of nodes
        )rr rs rrzGraph.number_of_nodesÝó€ô4—:‘:‹Ðrcó,—t|j«S)z-
        Returns the number of edges
        )rr rs rrzGraph.number_of_edgesãrLrcó,—t|j«S)z6
        Iterates over all nodes in the graph
        )Úiterr rs rÚ__iter__zGraph.__iter__és€ôD—J‘JÓÐrcóH—t|jj««S)zS
        Return a list of the node ids for all visible nodes in the graph.
        )r9r r:rs rÚ    node_listzGraph.node_listïó€ôD—J‘J—O‘OÓ%Ó&Ð&rcóH—t|jj««S)zI
        Returns an iterator for all visible nodes in the graph.
        )r9r r:rs rÚ    edge_listzGraph.edge_listõrSrcó,—t|j«S)z4
        Returns the number of hidden edges
        )rr rs rÚnumber_of_hidden_edgeszGraph.number_of_hidden_edgesûó€ô4×$Ñ$Ó%Ð%rcó,—t|j«S)z4
        Returns the number of hidden nodes
        )rrrs rÚnumber_of_hidden_nodeszGraph.number_of_hidden_nodesrXrcóH—t|jj««S)z8
        Returns the list with the hidden nodes
        )r9rr:rs rÚhidden_node_listzGraph.hidden_node_listó€ôD×%Ñ%×*Ñ*Ó,Ó-Ð-rcóH—t|jj««S)z6
        Returns a list with the hidden edges
        )r9r r:rs rÚhidden_edge_listzGraph.hidden_edge_list r]rcó4—|j|\}}}||||fS)zQ
        return node, node data, outgoing edges, incoming edges for node
        rA)rrÚincomingÚoutgoingrs     rÚ describe_nodezGraph.describe_nodes(€ð$(§:¡:¨dÑ#3Ñ ˆ(˜DؐT˜8 XÐ-Ð-rcó4—|j|\}}}||||fS)z=
        return edge, edge data, head, tail for edge
        ©r rEs     rÚ describe_edgezGraph.describe_edges(€ð Ÿ:™: dÑ+шˆdDؐT˜4 Ð%Ð%rcó&—|j|dS)z9
        Returns the data associated with a node
        rrAr>s  rr zGraph.node_data!ó€ðz‰z˜$Ñ Ñ"Ð"rcó&—|j|dS)z:
        Returns the data associated with an edge
        rrer;s  rr(zGraph.edge_data'rhrcóJ—|j|dd|fz|j|<y)z;
        Replace the edge data for a specific edge
        rrNre)rr*r(s   rÚupdate_edge_datazGraph.update_edge_data-s)€ð Ÿ:™: dÑ+¨A¨aÐ0°I°<Ñ?ˆ
‰
4Òrcó&—|j|dS)z;
        Returns the node of the head of the edge.
        rrer;s  rrz
Graph.head3rhrcó&—|j|dS)z7
        Returns node of the tail of the edge.
        r#rer;s  rrz
Graph.tail9rhrcóh—|j|«Dcgc]}|j|«‘Œc}Scc}w)z;
        List of nodes connected by outgoing edges
        rH©rrÚns   rÚout_nbrszGraph.out_nbrs?ó)€ð'+§n¡n°TÓ&:Ö; —    ‘    ˜!• Ò;Ð;ùÒ;ó”/cóh—|j|«Dcgc]}|j|«‘Œc}Scc}w)z;
        List of nodes connected by incoming edges
        )Ú    inc_edgesrros   rÚinc_nbrszGraph.inc_nbrsErrrscó€—ttj|j|«|j    |«z««S)zH
        List of nodes connected by incoming and outgoing edges
        )r9ÚdictÚfromkeysrvrqr>s  rÚall_nbrszGraph.all_nbrsKs/€ô”D—M‘M $§-¡-°Ó"5¸¿ ¹ ÀdÓ8KÑ"KÓLÓMÐMrcóp—    t|j|d«S#t$rtd|z«‚wxYw)z6
        Returns a list of the outgoing edges
        r#r0©r9r r%rr>s  rrIzGraph.out_edgesQó@€ð    7ܘŸ
™
 4Ñ(¨Ñ+Ó,Ð ,øÜò    7ÜÐ.°Ñ5Ó6Ð 6ð    7úó‚5cóp—    t|j|d«S#t$rtd|z«‚wxYw)z6
        Returns a list of the incoming edges
        rr0r|r>s  rruzGraph.inc_edgesZr}r~cóZ—t|j|«|j|«z«S)z?
        Returns a list of incoming and outging edges.
        )ÚsetrurIr>s  rr1zGraph.all_edgescs&€ô4—>‘> $Ó'¨$¯.©.¸Ó*>Ñ>Ó?Ð?rcó6—t|j|««S)z6
        Returns the number of outgoing edges
        )rrIr>s  rÚ
out_degreezGraph.out_degreeió€ô4—>‘> $Ó'Ó(Ð(rcó6—t|j|««S)z6
        Returns the number of incoming edges
        )rrur>s  rÚ
inc_degreezGraph.inc_degreeor„rcóH—|j|«|j|«zS)z,
        The total degree of a node
        )r†rƒr>s  rÚ
all_degreezGraph.all_degreeus!€ð‰˜tÓ$ t§¡°tÓ'<Ñ<Ð<rcóP—g}t«}i}|r%|j}|j}|j}n$|j}|j
}|j }|j«D]#}||«}    |    r|    ||<Œ|j|«Œ%|re|j«}
|j|
«||
«D]6} || «} | |vsŒ|| xxdzcc<|| dk(sŒ&|j| «Œ8|rŒet|«t|j««k(rd} | |fSd} | |fS)zì
        Topological sort.
 
        Returns a list of nodes where the successors (based on outgoing and
        incoming edges selected by the forward parameter) of any given node
        appear in the sequence after that node.
        r#rTF) rrIr†rrurƒrrRr$Úpopleftr)rÚforwardÚ    topo_listÚqueueÚindegÚ    get_edgesÚ
get_degreeÚget_nextrÚdegreeÚ    curr_noder*r'Úvalids              rÚ
_topo_sortzGraph._topo_sort{s4€ðˆ    Ü“ˆØˆñ ØŸ™ˆIØŸ™ˆJØ—y‘y‰HàŸ™ˆIØŸ™ˆJØ—y‘yˆHà—N‘NÓ$ò    #ˆDÙ Ó%ˆFÙØ$d’ à— ‘ ˜TÕ"ð     #ñØŸ ™ ›ˆIØ × Ñ ˜YÔ 'Ù! )Ó,ò .Ù" 4›.Ø˜eÒ#ؘ'“N aÑ'“NؘW‘~¨Ó*ØŸ ™  WÕ-ð  .òô ˆy‹>œS §¡Ó!1Ó2Ò 2؈Eð
yÐ!Ð!ðˆEàyÐ!Ð!rcó&—|jd¬«S)zµ
        Topological sort.
 
        Returns a list of nodes where the successors (based on outgoing edges)
        of any given node appear in the sequence after that node.
        T©r‹©r•rs rÚforw_topo_sortzGraph.forw_topo_sortªs€ð‰ tˆÓ,Ð,rcó&—|jd¬«S)z½
        Reverse topological sort.
 
        Returns a list of nodes where the successors (based on incoming edges)
        of any given node appear in the sequence after that node.
        Fr—r˜rs rÚback_topo_sortzGraph.back_topo_sort³s€ð‰ uˆÓ-Ð-rcó6—|r|j}|j}n|j}|j}t    «}||«}|D]}|j |«Œ|D]6}||«D])}|r|j ||«Œ|j ||«Œ+Œ8|S)z£
        Private method creates a subgraph in a bfs order.
 
        The forward parameter specifies whether it is a forward or backward
        traversal.
        )Úforw_bfsrqÚback_bfsrvrr!r)    rÚstart_idr‹Úget_bfsÚget_nbrsÚgÚbfs_listrÚnbr_ids             rÚ _bfs_subgraphzGraph._bfs_subgraph¼s¡€ñ Ø—m‘mˆGØ—}‘}‰Hà—m‘mˆGØ—}‘}ˆHä ‹GˆÙ˜8Ó$ˆØò    ˆDØ J‰JtÕ ð    ðò    -ˆDÙ" 4›.ò -ÙØ—J‘J˜t VÕ,à—J‘J˜v tÕ,ñ     -ð    -ðˆrcó(—|j|d¬«S)z‡
        Creates and returns a subgraph consisting of the breadth first
        reachable nodes based on their outgoing edges.
        Tr—©r¥©rrŸs  rÚforw_bfs_subgraphzGraph.forw_bfs_subgraphØs€ð
×!Ñ! (°DÐ!Ó9Ð9rcó(—|j|d¬«S)z…
        Creates and returns a subgraph consisting of the breadth first
        reachable nodes based on the incoming edges.
        Fr—r§r¨s  rÚback_bfs_subgraphzGraph.back_bfs_subgraphßs€ð
×!Ñ! (°EÐ!Ó:Ð:rc#óZK—|ht|g«}}|r|j}|j}n|j}|j}|rc|j «}|–—||k(ryt ||««D]1}    ||    «}
|
|vsŒ|j|
«|j|
«Œ3|rŒbyy­w)z¡
        Collecting nodes in some depth first traversal.
 
        The forward parameter specifies whether it is a forward or backward
        traversal.
        N)    rrIrrurÚpopÚsortedÚaddr$) rÚstartÚendr‹ÚvisitedÚstackrr‘r“r*rs            rÚiterdfsz Graph.iterdfsæs¥èø€ð ˜¤%¨¨£.ˆá ØŸ™ˆIØ—y‘y‰HàŸ™ˆIØ—y‘yˆHáØŸ    ™    › ˆIØŠOؘCÒØÜ™y¨Ó3Ó4ò 'Ù “~Ø˜wÒ&Ø—K‘K Ô%Ø—L‘L Õ&ð     'ô ùs‚A?B+Â&B+Â)B+c#óŠK—|ht|g«}}|r|j}|j}n|j}|j}|j
}    |ro|j «}
|    |
«} | |    || «sŒ'| –—|
|k(ry||
«D]1} || «} | |vsŒ|j| «|j| «Œ3|rŒnyy­w)zÛ
        Perform a depth-first walk of the graph (as ``iterdfs``)
        and yield the item data of every node where condition matches. The
        condition callback is only called when node_data is not None.
        N)    rrIrrurr r­r¯r$)rr°r±r‹Ú    conditionr²r³rr‘Úget_datar“Ú    curr_datar*rs              rÚiterdatazGraph.iterdatasÉèø€ð ˜¤%¨¨£.ˆá ØŸ™ˆIØ—y‘y‰HàŸ™ˆIØ—y‘yˆHà—>‘>ˆáØŸ    ™    › ˆIÙ  Ó+ˆIØÐ$ØÐ(±¸9Ô1EØØ’ؘCÒØÙ! )Ó,ò 'Ù “~Ø˜wÒ&Ø—K‘K Ô%Ø—L‘L Õ&ð     'ôùs‚BCÂ&CÃCc#ó`K—t|dfg«|h}}|r|j}|j}n|j}|j}|rd|j «\}}    ||    f–—||k(ry||«D]6}
||
«} | |vsŒ|j | «|j| |    dzf«Œ8|rŒcyy­w)zÒ
        The forward parameter specifies whether it is a forward or backward
        traversal.  Returns a list of tuples where the first value is the hop
        value the second value is the node id.
        rr#N)rrIrrurrŠr¯r$) rr°r±r‹rr²rr‘r“Ú    curr_stepr*rs             rÚ_iterbfszGraph._iterbfs"s»èø€ô  ¨ 
˜|Ó,¨u¨gˆwˆñ ØŸ™ˆIØ—y‘y‰HàŸ™ˆIØ—y‘yˆHáØ#(§=¡=£?Ñ  ˆIyؘiÐ(Ò (ؘCÒØÙ! )Ó,ò 8Ù “~Ø˜wÒ&Ø—K‘K Ô%Ø—L‘L $¨    °A© Ð!6Õ7ð     8ô ùs‚A=B.Â+B.Â,B.có\—|j||d¬«Dcgc]\}}|‘Œ    c}}Scc}}w)zª
        Returns a list of nodes in some forward BFS order.
 
        Starting from the start node the breadth first search proceeds along
        outgoing edges.
        Tr—©r¼)rr°r±rÚsteps     rrzGraph.forw_bfs=s+€ð(,§}¡}°U¸CÈ }Ó'N×O™˜˜t’ÓOÐOùÓOó˜ (có\—|j||d¬«Dcgc]\}}|‘Œ    c}}Scc}}w)z«
        Returns a list of nodes in some backward BFS order.
 
        Starting from the start node the breadth first search proceeds along
        incoming edges.
        Fr—r¾)rr°r±rÚ_s     rržzGraph.back_bfsFs+€ð%)§M¡M°%¸Àe MÓ$L×M™˜˜q’ÓMÐMùÓMrÀcó<—t|j||d¬««S)z¨
        Returns a list of nodes in some forward DFS order.
 
        Starting with the start node the depth first search proceeds along
        outgoing edges.
        Tr—©r9r´©rr°r±s   rÚforw_dfszGraph.forw_dfsOs€ôD—L‘L ¨°TLÓ:Ó;Ð;rcó<—t|j||d¬««S)z©
        Returns a list of nodes in some backward DFS order.
 
        Starting from the start node the depth first search proceeds along
        incoming edges.
        Fr—rÄrÅs   rÚback_dfszGraph.back_dfsXs€ôD—L‘L ¨°ULÓ;Ó<Ð<rcó†—|j«}|D],}|j|«}t|«t|«k7sŒ,yy)zq
        Returns :py:data:`True` if the graph's every node can be reached from
        every other node.
        FT)rRrr)rrRrr£s    rÚ    connectedzGraph.connectedasE€ð
—N‘NÓ$ˆ    Øò    ˆDØ—}‘} TÓ*ˆHܐ8‹}¤ I£Ó.Ùð    ðrcó@—d}t|j|««}||vr|j|«|D]B}t|j|««}||vr|j|«|t||z«z }ŒDt|«}|rt    |«||dz
zz }|Sd}|S)a–
        Computes and returns the local clustering coefficient of node.
 
        The local cluster coefficient is proportion of the actual number of
        edges between neighbours of node and the maximum number of edges
        between those neighbours.
 
        See "Local Clustering Coefficient" on
        <http://en.wikipedia.org/wiki/Clustering_coefficient>
        for a formal definition.
        rr#g)rrqr-rÚfloat)rrÚnumÚnbr_setÚnbrÚsec_setÚnbr_numÚ
clust_coefs        rrÒzGraph.clust_coefms²€ðˆÜd—m‘m DÓ)Ó*ˆà 7‰?Ø N‰N˜4Ô  àò    *ˆCܘ$Ÿ-™-¨Ó,Ó-ˆGؐg‰~Ø—‘˜sÔ#Ø ”3w Ñ(Ó)Ñ )‰Cð        *ô g“,ˆÙ ܘs› w°'¸A±+Ñ'>Ñ?ˆJðÐðˆJØÐrcóz—|rt|j||d¬««St|j||d¬««S)a$
        Computes the hop distance to all nodes centered around a node.
 
        First order neighbours are at hop 1, their neigbours are at hop 2 etc.
        Uses :py:meth:`forw_bfs` or :py:meth:`back_bfs` depending on the value
        of the forward parameter.  If the distance between all neighbouring
        nodes is 1 the hop number corresponds to the shortest distance between
        the nodes.
 
        :param start: the starting node
        :param end: ending node (optional). When not specified will search the
            whole graph.
        :param forward: directionality parameter (optional).
            If C{True} (default) it uses L{forw_bfs} otherwise L{back_bfs}.
        :return: returns a list of tuples where each tuple contains the
            node and the hop.
 
        Typical usage::
 
            >>> print (graph.get_hops(1, 8))
            >>> [(1, 0), (2, 1), (3, 1), (4, 2), (5, 3), (7, 4), (8, 5)]
            # node 1 is at 0 hops
            # node 2 is at 1 hop
            # ...
            # node 8 is at 5 hops
        T)r°r±r‹F)r9r¼)rr°r±r‹s    rÚget_hopszGraph.get_hopsŒs;€ñ6 ܘŸ ™ ¨E°sÀD˜ ÓIÓJÐ J䘟 ™ ¨E°sÀE˜ ÓJÓKÐ Kr)N)r#T)T)NT)NTN):Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrr!rr.r3r6r5r<r?rBrFrJrrrPrRrUrWrZr\r_rcrfr r(rkrrrqrvrzrIrur1rƒr†rˆr•r™r›r¥r©r«r´r¹r¼rržrÆrÈrÊrÒrÔ©rrrrs„ñó&Mò(
ó 3ó,!òF 7ò 7ò 7ò 7òò$ò"ò
òòò ò  ò 'ò 'ò &ò &ò .ò .ò .ò&ò#ò #ò @ò #ò #ò <ò <ò Nò 7ò7ò@ò )ò )ò =ó -"ò^-ò.óò8:ò;ó'ó6'óB8ó6PóNó<ó=ò
òô>LrrN)rØÚ collectionsrÚaltgraphrÚobjectrrÙrrú<module>rÝs"ðñ õåôU
LˆFõU
Lr