summaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/networkx/linalg/__pycache__/attrmatrix.cpython-312.pyc
blob: f5bb4a74fa303ea905992b9283850c14907b465f (plain)
ofshex dumpascii
0000 cb 0d 0d 0a 00 00 00 00 85 fa a7 68 1c 3e 00 00 e3 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 ...........h.>..................
0020 00 00 00 00 00 f3 a6 00 00 00 97 00 64 00 5a 00 64 01 64 02 6c 01 5a 02 64 03 64 04 67 02 5a 03 ............d.Z.d.d.l.Z.d.d.g.Z.
0040 64 05 84 00 5a 04 64 06 84 00 5a 05 02 00 65 02 6a 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d...Z.d...Z...e.j...............
0060 00 00 00 00 64 07 64 02 69 01 64 08 ac 09 ab 02 00 00 00 00 00 00 09 00 09 00 09 00 09 00 09 00 ....d.d.i.d.....................
0080 09 00 64 0c 64 0a 84 01 ab 00 00 00 00 00 00 00 5a 07 02 00 65 02 6a 0c 00 00 00 00 00 00 00 00 ..d.d...........Z...e.j.........
00a0 00 00 00 00 00 00 00 00 00 00 64 07 64 02 69 01 64 08 ac 09 ab 02 00 00 00 00 00 00 09 00 64 0d ..........d.d.i.d.............d.
00c0 64 0b 84 01 ab 00 00 00 00 00 00 00 5a 08 79 02 29 0e 7a 47 0a 46 75 6e 63 74 69 6f 6e 73 20 66 d...........Z.y.).zG.Functions.f
00e0 6f 72 20 63 6f 6e 73 74 72 75 63 74 69 6e 67 20 6d 61 74 72 69 78 2d 6c 69 6b 65 20 6f 62 6a 65 or.constructing.matrix-like.obje
0100 63 74 73 20 66 72 6f 6d 20 67 72 61 70 68 20 61 74 74 72 69 62 75 74 65 73 2e 0a e9 00 00 00 00 cts.from.graph.attributes.......
0120 4e da 0b 61 74 74 72 5f 6d 61 74 72 69 78 da 12 61 74 74 72 5f 73 70 61 72 73 65 5f 6d 61 74 72 N..attr_matrix..attr_sparse_matr
0140 69 78 63 02 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 03 00 00 00 f3 42 00 00 00 87 00 87 01 ixc.....................B.......
0160 97 00 89 01 80 05 64 01 84 00 7d 02 7c 02 53 00 74 01 00 00 00 00 00 00 00 00 89 01 ab 01 00 00 ......d...}.|.S.t...............
0180 00 00 00 00 73 08 88 00 88 01 66 02 64 02 84 08 7d 02 7c 02 53 00 89 01 7d 02 7c 02 53 00 29 03 ....s.....f.d...}.|.S...}.|.S.).
01a0 61 03 03 00 00 52 65 74 75 72 6e 73 20 61 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20 72 65 74 a....Returns.a.function.that.ret
01c0 75 72 6e 73 20 61 20 76 61 6c 75 65 20 66 72 6f 6d 20 47 2e 6e 6f 64 65 73 5b 75 5d 2e 0a 0a 20 urns.a.value.from.G.nodes[u]....
01e0 20 20 20 57 65 20 72 65 74 75 72 6e 20 61 20 66 75 6e 63 74 69 6f 6e 20 65 78 70 65 63 74 69 6e ...We.return.a.function.expectin
0200 67 20 61 20 6e 6f 64 65 20 61 73 20 69 74 73 20 73 6f 6c 65 20 61 72 67 75 6d 65 6e 74 2e 20 54 g.a.node.as.its.sole.argument..T
0220 68 65 6e 2c 20 69 6e 20 74 68 65 0a 20 20 20 20 73 69 6d 70 6c 65 73 74 20 73 63 65 6e 61 72 69 hen,.in.the.....simplest.scenari
0240 6f 2c 20 74 68 65 20 72 65 74 75 72 6e 65 64 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 72 65 o,.the.returned.function.will.re
0260 74 75 72 6e 20 47 2e 6e 6f 64 65 73 5b 75 5d 5b 6e 6f 64 65 5f 61 74 74 72 5d 2e 0a 20 20 20 20 turn.G.nodes[u][node_attr]......
0280 48 6f 77 65 76 65 72 2c 20 77 65 20 61 6c 73 6f 20 68 61 6e 64 6c 65 20 74 68 65 20 63 61 73 65 However,.we.also.handle.the.case
02a0 20 77 68 65 6e 20 60 6e 6f 64 65 5f 61 74 74 72 60 20 69 73 20 4e 6f 6e 65 20 28 72 65 74 75 72 .when.`node_attr`.is.None.(retur
02c0 6e 73 20 74 68 65 20 6e 6f 64 65 29 0a 20 20 20 20 6f 72 20 77 68 65 6e 20 60 6e 6f 64 65 5f 61 ns.the.node).....or.when.`node_a
02e0 74 74 72 60 20 69 73 20 61 20 66 75 6e 63 74 69 6f 6e 20 69 74 73 65 6c 66 2e 0a 0a 20 20 20 20 ttr`.is.a.function.itself.......
0300 50 61 72 61 6d 65 74 65 72 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 47 20 Parameters.....----------.....G.
0320 3a 20 67 72 61 70 68 0a 20 20 20 20 20 20 20 20 41 20 4e 65 74 77 6f 72 6b 58 20 67 72 61 70 68 :.graph.........A.NetworkX.graph
0340 0a 0a 20 20 20 20 6e 6f 64 65 5f 61 74 74 72 20 3a 20 7b 4e 6f 6e 65 2c 20 73 74 72 2c 20 63 61 ......node_attr.:.{None,.str,.ca
0360 6c 6c 61 62 6c 65 7d 0a 20 20 20 20 20 20 20 20 53 70 65 63 69 66 69 63 61 74 69 6f 6e 20 6f 66 llable}.........Specification.of
0380 20 68 6f 77 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 6e 6f 64 65 20 61 74 74 72 69 .how.the.value.of.the.node.attri
03a0 62 75 74 65 20 73 68 6f 75 6c 64 20 62 65 20 6f 62 74 61 69 6e 65 64 0a 20 20 20 20 20 20 20 20 bute.should.be.obtained.........
03c0 66 72 6f 6d 20 74 68 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 20 64 69 63 74 69 6f 6e 61 from.the.node.attribute.dictiona
03e0 72 79 2e 0a 0a 20 20 20 20 52 65 74 75 72 6e 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 ry.......Returns.....-------....
0400 20 76 61 6c 75 65 20 3a 20 66 75 6e 63 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 41 20 66 75 6e 63 .value.:.function.........A.func
0420 74 69 6f 6e 20 65 78 70 65 63 74 69 6e 67 20 61 20 6e 6f 64 65 20 61 73 20 69 74 73 20 73 6f 6c tion.expecting.a.node.as.its.sol
0440 65 20 61 72 67 75 6d 65 6e 74 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 0a 20 20 e.argument..The.function.will...
0460 20 20 20 20 20 20 72 65 74 75 72 6e 73 20 61 20 76 61 6c 75 65 20 66 72 6f 6d 20 47 2e 6e 6f 64 ......returns.a.value.from.G.nod
0480 65 73 5b 75 5d 20 74 68 61 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 60 65 64 67 65 5f 61 74 74 72 es[u].that.depends.on.`edge_attr
04a0 60 2e 0a 0a 20 20 20 20 63 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 13 00 00 00 f3 06 00 `.......c.......................
04c0 00 00 97 00 7c 00 53 00 a9 01 4e a9 00 29 01 da 01 75 73 01 00 00 00 20 fa 61 2f 68 6f 6d 65 2f ....|.S...N..)...us......a/home/
04e0 62 6c 61 63 6b 68 61 6f 2f 75 69 75 63 2d 63 6f 75 72 73 65 2d 67 72 61 70 68 2f 2e 76 65 6e 76 blackhao/uiuc-course-graph/.venv
0500 2f 6c 69 62 2f 70 79 74 68 6f 6e 33 2e 31 32 2f 73 69 74 65 2d 70 61 63 6b 61 67 65 73 2f 6e 65 /lib/python3.12/site-packages/ne
0520 74 77 6f 72 6b 78 2f 6c 69 6e 61 6c 67 2f 61 74 74 72 6d 61 74 72 69 78 2e 70 79 da 05 76 61 6c tworkx/linalg/attrmatrix.py..val
0540 75 65 7a 1a 5f 6e 6f 64 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 24 00 uez._node_value.<locals>.value$.
0560 00 00 73 07 00 00 00 80 00 d8 13 14 88 48 f3 00 00 00 00 63 01 00 00 00 00 00 00 00 00 00 00 00 ..s..........H.....c............
0580 02 00 00 00 13 00 00 00 f3 28 00 00 00 95 02 97 00 89 01 6a 00 00 00 00 00 00 00 00 00 00 00 00 .........(.........j............
05a0 00 00 00 00 00 00 00 7c 00 19 00 00 00 89 02 19 00 00 00 53 00 72 07 00 00 00 29 01 da 05 6e 6f .......|...........S.r....)...no
05c0 64 65 73 29 03 72 09 00 00 00 da 01 47 da 09 6e 6f 64 65 5f 61 74 74 72 73 03 00 00 00 20 80 80 des).r......G..node_attrs.......
05e0 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 6e 6f 64 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e r....r....z._node_value.<locals>
0600 2e 76 61 6c 75 65 29 00 00 00 73 16 00 00 00 f8 80 00 d8 13 14 97 37 91 37 98 31 91 3a 98 69 d1 .value)...s...........7.7.1.:.i.
0620 13 28 d0 0c 28 72 0c 00 00 00 29 01 da 08 63 61 6c 6c 61 62 6c 65 29 03 72 0f 00 00 00 72 10 00 .(..(r....)...callable).r....r..
0640 00 00 72 0b 00 00 00 73 03 00 00 00 60 60 20 72 0a 00 00 00 da 0b 5f 6e 6f 64 65 5f 76 61 6c 75 ..r....s....``.r......_node_valu
0660 65 72 12 00 00 00 0a 00 00 00 73 39 00 00 00 f9 80 00 f0 30 00 08 11 d0 07 18 f2 04 01 09 15 f0 er........s9.......0............
0680 20 00 0c 11 80 4c f4 1b 00 0e 16 90 69 d4 0d 20 f5 04 01 09 29 f0 16 00 0c 11 80 4c f0 05 00 11 .....L......i.......)......L....
06a0 1a 88 05 e0 0b 10 80 4c 72 0c 00 00 00 63 02 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 03 00 .......Lr....c..................
06c0 00 00 f3 ea 00 00 00 87 00 87 01 97 00 89 01 80 1c 89 00 6a 01 00 00 00 00 00 00 00 00 00 00 00 ...................j............
06e0 00 00 00 00 00 00 00 ab 00 00 00 00 00 00 00 72 07 88 00 66 01 64 01 84 08 7d 02 7c 02 53 00 64 ...............r...f.d...}.|.S.d
0700 02 84 00 7d 02 7c 02 53 00 74 03 00 00 00 00 00 00 00 00 89 01 ab 01 00 00 00 00 00 00 73 45 89 ...}.|.S.t...................sE.
0720 01 64 03 6b 28 00 00 72 20 89 00 6a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ab .d.k(..r...j....................
0740 00 00 00 00 00 00 00 72 08 88 00 88 01 66 02 64 04 84 08 7d 02 7c 02 53 00 88 00 88 01 66 02 64 .......r.....f.d...}.|.S.....f.d
0760 05 84 08 7d 02 7c 02 53 00 89 00 6a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ab ...}.|.S...j....................
0780 00 00 00 00 00 00 00 72 08 88 00 88 01 66 02 64 06 84 08 7d 02 7c 02 53 00 88 00 88 01 66 02 64 .......r.....f.d...}.|.S.....f.d
07a0 07 84 08 7d 02 7c 02 53 00 89 01 7d 02 7c 02 53 00 29 08 61 ce 04 00 00 52 65 74 75 72 6e 73 20 ...}.|.S...}.|.S.).a....Returns.
07c0 61 20 66 75 6e 63 74 69 6f 6e 20 74 68 61 74 20 72 65 74 75 72 6e 73 20 61 20 76 61 6c 75 65 20 a.function.that.returns.a.value.
07e0 66 72 6f 6d 20 47 5b 75 5d 5b 76 5d 2e 0a 0a 20 20 20 20 53 75 70 70 6f 73 65 20 74 68 65 72 65 from.G[u][v].......Suppose.there
0800 20 65 78 69 73 74 73 20 61 6e 20 65 64 67 65 20 62 65 74 77 65 65 6e 20 75 20 61 6e 64 20 76 2e .exists.an.edge.between.u.and.v.
0820 20 20 54 68 65 6e 20 77 65 20 72 65 74 75 72 6e 20 61 20 66 75 6e 63 74 69 6f 6e 0a 20 20 20 20 ..Then.we.return.a.function.....
0840 65 78 70 65 63 74 69 6e 67 20 75 20 61 6e 64 20 76 20 61 73 20 61 72 67 75 6d 65 6e 74 73 2e 20 expecting.u.and.v.as.arguments..
0860 20 46 6f 72 20 47 72 61 70 68 20 61 6e 64 20 44 69 47 72 61 70 68 2c 20 47 5b 75 5d 5b 76 5d 20 .For.Graph.and.DiGraph,.G[u][v].
0880 69 73 0a 20 20 20 20 74 68 65 20 65 64 67 65 20 61 74 74 72 69 62 75 74 65 20 64 69 63 74 69 6f is.....the.edge.attribute.dictio
08a0 6e 61 72 79 2c 20 61 6e 64 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 28 65 73 73 65 6e 74 69 61 nary,.and.the.function.(essentia
08c0 6c 6c 79 29 20 72 65 74 75 72 6e 73 0a 20 20 20 20 47 5b 75 5d 5b 76 5d 5b 65 64 67 65 5f 61 74 lly).returns.....G[u][v][edge_at
08e0 74 72 5d 2e 20 20 48 6f 77 65 76 65 72 2c 20 77 65 20 61 6c 73 6f 20 68 61 6e 64 6c 65 20 63 61 tr]...However,.we.also.handle.ca
0900 73 65 73 20 77 68 65 6e 20 60 65 64 67 65 5f 61 74 74 72 60 20 69 73 20 4e 6f 6e 65 0a 20 20 20 ses.when.`edge_attr`.is.None....
0920 20 61 6e 64 20 77 68 65 6e 20 69 74 20 69 73 20 61 20 66 75 6e 63 74 69 6f 6e 20 69 74 73 65 6c .and.when.it.is.a.function.itsel
0940 66 2e 20 46 6f 72 20 4d 75 6c 74 69 47 72 61 70 68 20 61 6e 64 20 4d 75 6c 74 69 44 69 47 72 61 f..For.MultiGraph.and.MultiDiGra
0960 70 68 2c 20 47 5b 75 5d 5b 76 5d 0a 20 20 20 20 69 73 20 61 20 64 69 63 74 69 6f 6e 61 72 79 20 ph,.G[u][v].....is.a.dictionary.
0980 6f 66 20 61 6c 6c 20 65 64 67 65 73 20 62 65 74 77 65 65 6e 20 75 20 61 6e 64 20 76 2e 20 20 49 of.all.edges.between.u.and.v...I
09a0 6e 20 74 68 69 73 20 63 61 73 65 2c 20 74 68 65 20 72 65 74 75 72 6e 65 64 0a 20 20 20 20 66 75 n.this.case,.the.returned.....fu
09c0 6e 63 74 69 6f 6e 20 73 75 6d 73 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 60 65 64 67 65 5f 61 nction.sums.the.value.of.`edge_a
09e0 74 74 72 60 20 66 6f 72 20 65 76 65 72 79 20 65 64 67 65 20 62 65 74 77 65 65 6e 20 75 20 61 6e ttr`.for.every.edge.between.u.an
0a00 64 20 76 2e 0a 0a 20 20 20 20 50 61 72 61 6d 65 74 65 72 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d d.v.......Parameters.....-------
0a20 2d 2d 2d 0a 20 20 20 20 47 20 3a 20 67 72 61 70 68 0a 20 20 20 20 20 20 20 41 20 4e 65 74 77 6f ---.....G.:.graph........A.Netwo
0a40 72 6b 58 20 67 72 61 70 68 0a 0a 20 20 20 20 65 64 67 65 5f 61 74 74 72 20 3a 20 7b 4e 6f 6e 65 rkX.graph......edge_attr.:.{None
0a60 2c 20 73 74 72 2c 20 63 61 6c 6c 61 62 6c 65 7d 0a 20 20 20 20 20 20 20 20 53 70 65 63 69 66 69 ,.str,.callable}.........Specifi
0a80 63 61 74 69 6f 6e 20 6f 66 20 68 6f 77 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 65 cation.of.how.the.value.of.the.e
0aa0 64 67 65 20 61 74 74 72 69 62 75 74 65 20 73 68 6f 75 6c 64 20 62 65 20 6f 62 74 61 69 6e 65 64 dge.attribute.should.be.obtained
0ac0 0a 20 20 20 20 20 20 20 20 66 72 6f 6d 20 74 68 65 20 65 64 67 65 20 61 74 74 72 69 62 75 74 65 .........from.the.edge.attribute
0ae0 20 64 69 63 74 69 6f 6e 61 72 79 2c 20 47 5b 75 5d 5b 76 5d 2e 20 20 46 6f 72 20 6d 75 6c 74 69 .dictionary,.G[u][v]...For.multi
0b00 67 72 61 70 68 73 2c 20 47 5b 75 5d 5b 76 5d 0a 20 20 20 20 20 20 20 20 69 73 20 61 20 64 69 63 graphs,.G[u][v].........is.a.dic
0b20 74 69 6f 6e 61 72 79 20 6f 66 20 61 6c 6c 20 74 68 65 20 65 64 67 65 73 20 62 65 74 77 65 65 6e tionary.of.all.the.edges.between
0b40 20 75 20 61 6e 64 20 76 2e 20 20 54 68 69 73 20 61 6c 6c 6f 77 73 20 66 6f 72 0a 20 20 20 20 20 .u.and.v...This.allows.for......
0b60 20 20 20 73 70 65 63 69 61 6c 20 74 72 65 61 74 6d 65 6e 74 20 6f 66 20 6d 75 6c 74 69 65 64 67 ...special.treatment.of.multiedg
0b80 65 73 2e 0a 0a 20 20 20 20 52 65 74 75 72 6e 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 es.......Returns.....-------....
0ba0 20 76 61 6c 75 65 20 3a 20 66 75 6e 63 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 41 20 66 75 6e 63 .value.:.function.........A.func
0bc0 74 69 6f 6e 20 65 78 70 65 63 74 69 6e 67 20 74 77 6f 20 6e 6f 64 65 73 20 61 73 20 70 61 72 61 tion.expecting.two.nodes.as.para
0be0 6d 65 74 65 72 73 2e 20 54 68 65 20 6e 6f 64 65 73 20 73 68 6f 75 6c 64 0a 20 20 20 20 20 20 20 meters..The.nodes.should........
0c00 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 66 72 6f 6d 2d 20 61 6e 64 20 74 6f 2d 20 6e 6f 64 .represent.the.from-.and.to-.nod
0c20 65 20 6f 66 20 61 6e 20 65 64 67 65 2e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 0a e.of.an.edge..The.function.will.
0c40 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 61 20 76 61 6c 75 65 20 66 72 6f 6d 20 47 5b 75 5d ........return.a.value.from.G[u]
0c60 5b 76 5d 20 74 68 61 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 60 65 64 67 65 5f 61 74 74 72 60 2e [v].that.depends.on.`edge_attr`.
0c80 0a 0a 20 20 20 20 63 02 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 13 00 00 00 f3 26 00 00 00 ......c.....................&...
0ca0 95 01 97 00 74 01 00 00 00 00 00 00 00 00 89 02 7c 00 19 00 00 00 7c 01 19 00 00 00 ab 01 00 00 ....t...........|.....|.........
0cc0 00 00 00 00 53 00 72 07 00 00 00 29 01 da 03 6c 65 6e 29 03 72 09 00 00 00 da 01 76 72 0f 00 00 ....S.r....)...len).r......vr...
0ce0 00 73 03 00 00 00 20 20 80 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 67 65 5f 76 61 6c 75 65 .s.......r....r....z._edge_value
0d00 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 5b 00 00 00 73 15 00 00 00 f8 80 00 dc 17 1a 98 31 .<locals>.value[...s...........1
0d20 98 51 99 34 a0 01 99 37 93 7c d0 10 23 72 0c 00 00 00 63 02 00 00 00 00 00 00 00 00 00 00 00 00 .Q.4...7.|..#r....c.............
0d40 00 00 00 13 00 00 00 f3 04 00 00 00 97 00 79 01 a9 02 4e e9 01 00 00 00 72 08 00 00 00 29 02 72 ..............y...N.....r....).r
0d60 09 00 00 00 72 16 00 00 00 73 02 00 00 00 20 20 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 67 ....r....s......r....r....z._edg
0d80 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 60 00 00 00 73 05 00 00 00 80 e_value.<locals>.value`...s.....
0da0 00 d8 17 18 72 0c 00 00 00 da 06 77 65 69 67 68 74 63 02 00 00 00 00 00 00 00 00 00 00 00 05 00 ....r......weightc..............
0dc0 00 00 13 00 00 00 f3 54 00 00 00 95 02 97 00 74 01 00 00 00 00 00 00 00 00 88 03 66 01 64 01 84 .......T.......t...........f.d..
0de0 08 89 02 7c 00 19 00 00 00 7c 01 19 00 00 00 6a 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...|.....|.....j................
0e00 00 00 00 ab 00 00 00 00 00 00 00 44 00 ab 00 00 00 00 00 00 00 ab 01 00 00 00 00 00 00 53 00 29 ...........D.................S.)
0e20 02 4e 63 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 33 00 00 00 f3 42 00 00 00 95 01 4b 00 .Nc................3....B.....K.
0e40 01 00 97 00 7c 00 5d 16 00 00 7d 01 7c 01 6a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....|.]...}.|.j.................
0e60 00 00 89 02 64 00 ab 02 00 00 00 00 00 00 96 01 97 01 01 00 8c 18 04 00 79 01 ad 03 77 01 29 02 ....d...................y...w.).
0e80 72 19 00 00 00 4e a9 01 da 03 67 65 74 a9 03 da 02 2e 30 da 01 64 da 09 65 64 67 65 5f 61 74 74 r....N....get.....0..d..edge_att
0ea0 72 73 03 00 00 00 20 20 80 72 0a 00 00 00 fa 09 3c 67 65 6e 65 78 70 72 3e 7a 2d 5f 65 64 67 65 rs.......r......<genexpr>z-_edge
0ec0 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 3c _value.<locals>.value.<locals>.<
0ee0 67 65 6e 65 78 70 72 3e 6b 00 00 00 73 1c 00 00 00 f8 e8 00 f8 80 00 d2 1e 4d b0 71 98 71 9f 75 genexpr>k...s............M.q.q.u
0f00 99 75 a0 59 b0 01 d7 1f 32 d1 1e 4d f9 73 04 00 00 00 83 1c 1f 01 a9 02 da 03 73 75 6d da 06 76 .u.Y....2..M.s............sum..v
0f20 61 6c 75 65 73 a9 04 72 09 00 00 00 72 16 00 00 00 72 0f 00 00 00 72 22 00 00 00 73 04 00 00 00 alues..r....r....r....r"...s....
0f40 20 20 80 80 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 67 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 ....r....r....z._edge_value.<loc
0f60 61 6c 73 3e 2e 76 61 6c 75 65 6a 00 00 00 73 23 00 00 00 f8 80 00 dc 1b 1e d3 1e 4d b8 41 b8 61 als>.valuej...s#...........M.A.a
0f80 b9 44 c0 11 b9 47 bf 4e b9 4e d3 3c 4c d4 1e 4d d3 1b 4d d0 14 4d 72 0c 00 00 00 63 02 00 00 00 .D...G.N.N.<L..M..M..Mr....c....
0fa0 00 00 00 00 00 00 00 00 04 00 00 00 13 00 00 00 f3 34 00 00 00 95 02 97 00 89 02 7c 00 19 00 00 .................4.........|....
0fc0 00 7c 01 19 00 00 00 6a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 89 03 64 01 ab .|.....j.....................d..
0fe0 02 00 00 00 00 00 00 53 00 72 18 00 00 00 72 1d 00 00 00 72 27 00 00 00 73 04 00 00 00 20 20 80 .......S.r....r....r'...s.......
1000 80 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 67 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 .r....r....z._edge_value.<locals
1020 3e 2e 76 61 6c 75 65 6f 00 00 00 73 1c 00 00 00 f8 80 00 d8 1b 1c 98 51 99 34 a0 01 99 37 9f 3b >.valueo...s...........Q.4...7.;
1040 99 3b a0 79 b0 21 d3 1b 34 d0 14 34 72 0c 00 00 00 63 02 00 00 00 00 00 00 00 00 00 00 00 05 00 .;.y.!..4..4r....c..............
1060 00 00 13 00 00 00 f3 54 00 00 00 95 02 97 00 74 01 00 00 00 00 00 00 00 00 88 03 66 01 64 01 84 .......T.......t...........f.d..
1080 08 89 02 7c 00 19 00 00 00 7c 01 19 00 00 00 6a 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...|.....|.....j................
10a0 00 00 00 ab 00 00 00 00 00 00 00 44 00 ab 00 00 00 00 00 00 00 ab 01 00 00 00 00 00 00 53 00 29 ...........D.................S.)
10c0 02 4e 63 01 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 33 00 00 00 f3 28 00 00 00 95 01 4b 00 .Nc................3....(.....K.
10e0 01 00 97 00 7c 00 5d 09 00 00 7d 01 7c 01 89 02 19 00 00 00 96 01 97 01 01 00 8c 0b 04 00 79 00 ....|.]...}.|.................y.
1100 ad 03 77 01 72 07 00 00 00 72 08 00 00 00 72 1f 00 00 00 73 03 00 00 00 20 20 80 72 0a 00 00 00 ..w.r....r....r....s.......r....
1120 72 23 00 00 00 7a 2d 5f 65 64 67 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 r#...z-_edge_value.<locals>.valu
1140 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 3c 67 65 6e 65 78 70 72 3e 77 00 00 00 73 15 00 00 00 f8 e8 00 e.<locals>.<genexpr>w...s.......
1160 f8 80 00 d2 1e 46 b0 01 98 71 a0 19 9d 7c d1 1e 46 f9 73 04 00 00 00 83 0f 12 01 72 24 00 00 00 .....F...q...|..F.s........r$...
1180 72 27 00 00 00 73 04 00 00 00 20 20 80 80 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 67 65 5f r'...s........r....r....z._edge_
11a0 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 76 00 00 00 73 23 00 00 00 f8 80 00 value.<locals>.valuev...s#......
11c0 dc 1b 1e d3 1e 46 b0 51 b0 71 b1 54 b8 21 b1 57 b7 5e b1 5e d3 35 45 d4 1e 46 d3 1b 46 d0 14 46 .....F.Q.q.T.!.W.^.^.5E..F..F..F
11e0 72 0c 00 00 00 63 02 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 13 00 00 00 f3 1a 00 00 00 95 r....c..........................
1200 02 97 00 89 02 7c 00 19 00 00 00 7c 01 19 00 00 00 89 03 19 00 00 00 53 00 72 07 00 00 00 72 08 .....|.....|...........S.r....r.
1220 00 00 00 72 27 00 00 00 73 04 00 00 00 20 20 80 80 72 0a 00 00 00 72 0b 00 00 00 7a 1a 5f 65 64 ...r'...s........r....r....z._ed
1240 67 65 5f 76 61 6c 75 65 2e 3c 6c 6f 63 61 6c 73 3e 2e 76 61 6c 75 65 7b 00 00 00 73 16 00 00 00 ge_value.<locals>.value{...s....
1260 f8 80 00 d8 1b 1c 98 51 99 34 a0 01 99 37 a0 39 d1 1b 2d d0 14 2d 72 0c 00 00 00 29 02 da 0d 69 .......Q.4...7.9..-..-r....)...i
1280 73 5f 6d 75 6c 74 69 67 72 61 70 68 72 11 00 00 00 29 03 72 0f 00 00 00 72 22 00 00 00 72 0b 00 s_multigraphr....).r....r"...r..
12a0 00 00 73 03 00 00 00 60 60 20 72 0a 00 00 00 da 0b 5f 65 64 67 65 5f 76 61 6c 75 65 72 2d 00 00 ..s....``.r......_edge_valuer-..
12c0 00 37 00 00 00 73 9e 00 00 00 f9 80 00 f0 3e 00 08 11 d0 07 18 f0 06 00 0c 0d 8f 3f 89 3f d4 0b .7...s........>............?.?..
12e0 1c f4 04 01 0d 24 f0 68 01 00 0c 11 80 4c f2 5f 01 01 0d 19 f0 5e 01 00 0c 11 80 4c f4 59 01 00 .....$.h.....L._.....^.....L.Y..
1300 0e 16 90 69 d4 0d 20 f0 06 00 0c 15 98 08 d2 0b 20 e0 0f 10 8f 7f 89 7f d4 0f 20 f5 04 01 11 4e ...i...........................N
1320 01 f0 4a 01 00 0c 11 80 4c f5 41 01 01 11 35 f0 40 01 00 0c 11 80 4c f0 37 00 10 11 8f 7f 89 7f ..J.....L.A...5.@.....L.7.......
1340 d4 0f 20 f5 04 01 11 47 01 f0 32 00 0c 11 80 4c f5 29 01 11 2e f0 28 00 0c 11 80 4c f0 05 00 11 .......G..2....L.)....(....L....
1360 1a 88 05 e0 0b 10 80 4c 72 0c 00 00 00 72 22 00 00 00 72 10 00 00 00 29 02 da 0a 65 64 67 65 5f .......Lr....r"...r....)...edge_
1380 61 74 74 72 73 da 0a 6e 6f 64 65 5f 61 74 74 72 73 63 07 00 00 00 00 00 00 00 00 00 00 00 09 00 attrs..node_attrsc..............
13a0 00 00 03 00 00 00 f3 86 02 00 00 97 00 64 01 64 02 6c 00 7d 07 74 03 00 00 00 00 00 00 00 00 7c .............d.d.l.}.t.........|
13c0 00 7c 01 ab 02 00 00 00 00 00 00 7d 08 74 05 00 00 00 00 00 00 00 00 7c 00 7c 02 ab 02 00 00 00 .|.........}.t.........|.|......
13e0 00 00 00 7d 09 7c 04 80 20 74 07 00 00 00 00 00 00 00 00 7c 00 44 00 8f 0a 63 02 68 00 63 02 5d ...}.|...t.........|.D...c.h.c.]
1400 0a 00 00 7d 0a 02 00 7c 09 7c 0a ab 01 00 00 00 00 00 00 92 02 8c 0c 04 00 63 02 7d 0a ab 01 00 ...}...|.|...............c.}....
1420 00 00 00 00 00 7d 0b 6e 02 7c 04 7d 0b 74 09 00 00 00 00 00 00 00 00 7c 0b ab 01 00 00 00 00 00 .....}.n.|.}.t.........|........
1440 00 7d 0c 7c 00 6a 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ab 00 00 00 00 00 00 .}.|.j..........................
1460 00 0c 00 7d 0d 74 0d 00 00 00 00 00 00 00 00 74 0f 00 00 00 00 00 00 00 00 7c 0b 74 11 00 00 00 ...}.t.........t.........|.t....
1480 00 00 00 00 00 7c 0c ab 01 00 00 00 00 00 00 ab 02 00 00 00 00 00 00 ab 01 00 00 00 00 00 00 7d .....|.........................}
14a0 0e 7c 07 6a 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7c 0c 7c 0c 66 02 7c 05 7c .|.j...................|.|.f.|.|
14c0 06 ac 03 ab 03 00 00 00 00 00 00 7d 0f 74 15 00 00 00 00 00 00 00 00 ab 00 00 00 00 00 00 00 7d ...........}.t.................}
14e0 10 7c 00 6a 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ab 00 00 00 00 00 00 00 44 .|.j...........................D
1500 00 5d 60 00 00 5c 02 00 00 7d 11 7d 12 7c 12 44 00 5d 42 00 00 7d 13 7c 0e 02 00 7c 09 7c 11 ab .]`..\...}.}.|.D.]B..}.|...|.|..
1520 01 00 00 00 00 00 00 19 00 00 00 7c 0e 02 00 7c 09 7c 13 ab 01 00 00 00 00 00 00 19 00 00 00 7d ...........|...|.|.............}
1540 15 7d 14 7c 13 7c 10 76 01 73 01 8c 1e 7c 0f 7c 14 7c 15 66 02 78 02 78 02 19 00 00 00 02 00 7c .}.|.|.v.s...|.|.|.f.x.x.......|
1560 08 7c 11 7c 13 ab 02 00 00 00 00 00 00 7a 0d 00 00 63 03 63 02 3c 00 00 00 7c 0d 73 01 8c 37 7c .|.|.........z...c.c.<...|.s..7|
1580 0f 7c 14 7c 15 66 02 19 00 00 00 7c 0f 7c 15 7c 14 66 02 3c 00 00 00 8c 44 04 00 7c 0d 73 01 8c .|.|.f.....|.|.|.f.<....D..|.s..
15a0 50 7c 10 6a 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7c 11 ab 01 00 00 00 00 00 P|.j...................|........
15c0 00 01 00 8c 62 04 00 7c 03 72 26 7c 0f 7c 0f 6a 1b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....b..|.r&|.|.j................
15e0 00 00 00 64 04 ac 05 ab 01 00 00 00 00 00 00 6a 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...d...........j................
1600 00 00 00 7c 0c 64 04 66 02 ab 01 00 00 00 00 00 00 7a 18 00 00 7d 0f 7c 04 80 04 7c 0f 7c 0b 66 ...|.d.f.........z...}.|...|.|.f
1620 02 53 00 7c 0f 53 00 63 02 01 00 63 02 7d 0a 77 00 29 06 61 b7 12 00 00 52 65 74 75 72 6e 73 20 .S.|.S.c...c.}.w.).a....Returns.
1640 74 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 61 74 72 69 78 20 75 73 69 6e 67 20 61 74 74 72 69 the.attribute.matrix.using.attri
1660 62 75 74 65 73 20 66 72 6f 6d 20 60 47 60 20 61 73 20 61 20 6e 75 6d 70 79 20 61 72 72 61 79 2e butes.from.`G`.as.a.numpy.array.
1680 0a 0a 20 20 20 20 49 66 20 6f 6e 6c 79 20 60 47 60 20 69 73 20 70 61 73 73 65 64 20 69 6e 2c 20 ......If.only.`G`.is.passed.in,.
16a0 74 68 65 6e 20 74 68 65 20 61 64 6a 61 63 65 6e 63 79 20 6d 61 74 72 69 78 20 69 73 20 63 6f 6e then.the.adjacency.matrix.is.con
16c0 73 74 72 75 63 74 65 64 2e 0a 0a 20 20 20 20 4c 65 74 20 41 20 62 65 20 61 20 64 69 73 63 72 65 structed.......Let.A.be.a.discre
16e0 74 65 20 73 65 74 20 6f 66 20 76 61 6c 75 65 73 20 66 6f 72 20 74 68 65 20 6e 6f 64 65 20 61 74 te.set.of.values.for.the.node.at
1700 74 72 69 62 75 74 65 20 60 6e 6f 64 65 5f 61 74 74 72 60 2e 20 54 68 65 6e 0a 20 20 20 20 74 68 tribute.`node_attr`..Then.....th
1720 65 20 65 6c 65 6d 65 6e 74 73 20 6f 66 20 41 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 72 6f e.elements.of.A.represent.the.ro
1740 77 73 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 6f 66 20 74 68 65 20 63 6f 6e 73 74 72 75 63 74 65 ws.and.columns.of.the.constructe
1760 64 20 6d 61 74 72 69 78 2e 0a 20 20 20 20 4e 6f 77 2c 20 69 74 65 72 61 74 65 20 74 68 72 6f 75 d.matrix......Now,.iterate.throu
1780 67 68 20 65 76 65 72 79 20 65 64 67 65 20 65 3d 28 75 2c 76 29 20 69 6e 20 60 47 60 20 61 6e 64 gh.every.edge.e=(u,v).in.`G`.and
17a0 20 63 6f 6e 73 69 64 65 72 20 74 68 65 20 76 61 6c 75 65 0a 20 20 20 20 6f 66 20 74 68 65 20 65 .consider.the.value.....of.the.e
17c0 64 67 65 20 61 74 74 72 69 62 75 74 65 20 60 65 64 67 65 5f 61 74 74 72 60 2e 20 20 49 66 20 75 dge.attribute.`edge_attr`...If.u
17e0 61 20 61 6e 64 20 76 61 20 61 72 65 20 74 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 68 65 0a 20 a.and.va.are.the.values.of.the..
1800 20 20 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 20 60 6e 6f 64 65 5f 61 74 74 72 60 20 66 6f ...node.attribute.`node_attr`.fo
1820 72 20 75 20 61 6e 64 20 76 2c 20 72 65 73 70 65 63 74 69 76 65 6c 79 2c 20 74 68 65 6e 20 74 68 r.u.and.v,.respectively,.then.th
1840 65 20 76 61 6c 75 65 20 6f 66 0a 20 20 20 20 74 68 65 20 65 64 67 65 20 61 74 74 72 69 62 75 74 e.value.of.....the.edge.attribut
1860 65 20 69 73 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 6d 61 74 72 69 78 20 65 6c 65 6d 65 6e 74 e.is.added.to.the.matrix.element
1880 20 61 74 20 28 75 61 2c 20 76 61 29 2e 0a 0a 20 20 20 20 50 61 72 61 6d 65 74 65 72 73 0a 20 20 .at.(ua,.va).......Parameters...
18a0 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 47 20 3a 20 67 72 61 70 68 0a 20 20 20 20 20 ..----------.....G.:.graph......
18c0 20 20 20 54 68 65 20 4e 65 74 77 6f 72 6b 58 20 67 72 61 70 68 20 75 73 65 64 20 74 6f 20 63 6f ...The.NetworkX.graph.used.to.co
18e0 6e 73 74 72 75 63 74 20 74 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 61 74 72 69 78 2e 0a 0a 20 nstruct.the.attribute.matrix....
1900 20 20 20 65 64 67 65 5f 61 74 74 72 20 3a 20 73 74 72 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 ...edge_attr.:.str,.optional.(de
1920 66 61 75 6c 74 3a 20 6e 75 6d 62 65 72 20 6f 66 20 65 64 67 65 73 20 66 6f 72 20 65 61 63 68 20 fault:.number.of.edges.for.each.
1940 6d 61 74 72 69 78 20 65 6c 65 6d 65 6e 74 29 0a 20 20 20 20 20 20 20 20 45 61 63 68 20 65 6c 65 matrix.element).........Each.ele
1960 6d 65 6e 74 20 6f 66 20 74 68 65 20 6d 61 74 72 69 78 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 ment.of.the.matrix.represents.a.
1980 72 75 6e 6e 69 6e 67 20 74 6f 74 61 6c 20 6f 66 20 74 68 65 0a 20 20 20 20 20 20 20 20 73 70 65 running.total.of.the.........spe
19a0 63 69 66 69 65 64 20 65 64 67 65 20 61 74 74 72 69 62 75 74 65 20 66 6f 72 20 65 64 67 65 73 20 cified.edge.attribute.for.edges.
19c0 77 68 6f 73 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 whose.node.attributes.correspond
19e0 0a 20 20 20 20 20 20 20 20 74 6f 20 74 68 65 20 72 6f 77 73 2f 63 6f 6c 73 20 6f 66 20 74 68 65 .........to.the.rows/cols.of.the
1a00 20 6d 61 74 72 69 78 2e 20 54 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 75 73 74 20 62 65 20 70 .matrix..The.attribute.must.be.p
1a20 72 65 73 65 6e 74 20 66 6f 72 0a 20 20 20 20 20 20 20 20 61 6c 6c 20 65 64 67 65 73 20 69 6e 20 resent.for.........all.edges.in.
1a40 74 68 65 20 67 72 61 70 68 2e 20 49 66 20 6e 6f 20 61 74 74 72 69 62 75 74 65 20 69 73 20 73 70 the.graph..If.no.attribute.is.sp
1a60 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 77 65 0a 20 20 20 20 20 20 20 20 6a 75 73 74 20 63 6f ecified,.then.we.........just.co
1a80 75 6e 74 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 64 67 65 73 20 77 68 6f 73 65 20 6e 6f unt.the.number.of.edges.whose.no
1aa0 64 65 20 61 74 74 72 69 62 75 74 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 0a 20 20 20 20 20 20 20 de.attributes.correspond........
1ac0 20 74 6f 20 74 68 65 20 6d 61 74 72 69 78 20 65 6c 65 6d 65 6e 74 2e 0a 0a 20 20 20 20 6e 6f 64 .to.the.matrix.element.......nod
1ae0 65 5f 61 74 74 72 20 3a 20 73 74 72 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a e_attr.:.str,.optional.(default:
1b00 20 75 73 65 20 6e 6f 64 65 73 20 6f 66 20 74 68 65 20 67 72 61 70 68 29 0a 20 20 20 20 20 20 20 .use.nodes.of.the.graph)........
1b20 20 45 61 63 68 20 72 6f 77 20 61 6e 64 20 63 6f 6c 75 6d 6e 20 69 6e 20 74 68 65 20 6d 61 74 72 .Each.row.and.column.in.the.matr
1b40 69 78 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 76 61 6c 75 65 ix.represents.a.particular.value
1b60 0a 20 20 20 20 20 20 20 20 6f 66 20 74 68 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 2e 20 .........of.the.node.attribute..
1b80 20 54 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 75 73 74 20 62 65 20 70 72 65 73 65 6e 74 20 66 .The.attribute.must.be.present.f
1ba0 6f 72 20 61 6c 6c 20 6e 6f 64 65 73 0a 20 20 20 20 20 20 20 20 69 6e 20 74 68 65 20 67 72 61 70 or.all.nodes.........in.the.grap
1bc0 68 2e 20 4e 6f 74 65 2c 20 74 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 68 69 73 20 61 74 74 72 h..Note,.the.values.of.this.attr
1be0 69 62 75 74 65 20 73 68 6f 75 6c 64 20 62 65 20 72 65 6c 69 61 62 6c 79 0a 20 20 20 20 20 20 20 ibute.should.be.reliably........
1c00 20 68 61 73 68 61 62 6c 65 2e 20 53 6f 2c 20 66 6c 6f 61 74 20 76 61 6c 75 65 73 20 61 72 65 20 .hashable..So,.float.values.are.
1c20 6e 6f 74 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 49 66 20 6e 6f 20 61 74 74 72 69 62 75 74 65 not.recommended..If.no.attribute
1c40 20 69 73 0a 20 20 20 20 20 20 20 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 74 68 65 20 .is.........specified,.then.the.
1c60 72 6f 77 73 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 6e 6f 64 rows.and.columns.will.be.the.nod
1c80 65 73 20 6f 66 20 74 68 65 20 67 72 61 70 68 2e 0a 0a 20 20 20 20 6e 6f 72 6d 61 6c 69 7a 65 64 es.of.the.graph.......normalized
1ca0 20 3a 20 62 6f 6f 6c 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a 20 46 61 6c 73 .:.bool,.optional.(default:.Fals
1cc0 65 29 0a 20 20 20 20 20 20 20 20 49 66 20 54 72 75 65 2c 20 74 68 65 6e 20 65 61 63 68 20 72 6f e).........If.True,.then.each.ro
1ce0 77 20 69 73 20 6e 6f 72 6d 61 6c 69 7a 65 64 20 62 79 20 74 68 65 20 73 75 6d 6d 61 74 69 6f 6e w.is.normalized.by.the.summation
1d00 20 6f 66 20 69 74 73 20 76 61 6c 75 65 73 2e 0a 0a 20 20 20 20 72 63 5f 6f 72 64 65 72 20 3a 20 .of.its.values.......rc_order.:.
1d20 6c 69 73 74 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a 20 6f 72 64 65 72 20 6f list,.optional.(default:.order.o
1d40 66 20 6e 6f 64 65 73 20 69 6e 20 47 29 0a 20 20 20 20 20 20 20 20 41 20 6c 69 73 74 20 6f 66 20 f.nodes.in.G).........A.list.of.
1d60 74 68 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 20 76 61 6c 75 65 73 2e 20 54 68 69 73 20 the.node.attribute.values..This.
1d80 6c 69 73 74 20 73 70 65 63 69 66 69 65 73 20 74 68 65 20 6f 72 64 65 72 69 6e 67 0a 20 20 20 20 list.specifies.the.ordering.....
1da0 20 20 20 20 6f 66 20 72 6f 77 73 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 6f 66 20 74 68 65 20 61 ....of.rows.and.columns.of.the.a
1dc0 72 72 61 79 2e 20 49 66 20 6e 6f 20 6f 72 64 65 72 69 6e 67 20 69 73 20 70 72 6f 76 69 64 65 64 rray..If.no.ordering.is.provided
1de0 2c 20 74 68 65 6e 0a 20 20 20 20 20 20 20 20 74 68 65 20 6f 72 64 65 72 69 6e 67 20 77 69 6c 6c ,.then.........the.ordering.will
1e00 20 62 65 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 68 65 20 6e 6f 64 65 20 6f 72 64 65 72 20 69 .be.the.same.as.the.node.order.i
1e20 6e 20 60 47 60 2e 0a 20 20 20 20 20 20 20 20 57 68 65 6e 20 60 72 63 5f 6f 72 64 65 72 60 20 69 n.`G`..........When.`rc_order`.i
1e40 73 20 60 4e 6f 6e 65 60 2c 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 73 20 61 s.`None`,.the.function.returns.a
1e60 20 32 2d 74 75 70 6c 65 20 60 60 28 6d 61 74 72 69 78 2c 20 6f 72 64 65 72 69 6e 67 29 60 60 0a .2-tuple.``(matrix,.ordering)``.
1e80 0a 20 20 20 20 4f 74 68 65 72 20 50 61 72 61 6d 65 74 65 72 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d .....Other.Parameters.....------
1ea0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 64 74 79 70 65 20 3a 20 4e 75 6d 50 79 20 64 61 74 ----------.....dtype.:.NumPy.dat
1ec0 61 2d 74 79 70 65 2c 20 6f 70 74 69 6f 6e 61 6c 0a 20 20 20 20 20 20 20 20 41 20 76 61 6c 69 64 a-type,.optional.........A.valid
1ee0 20 4e 75 6d 50 79 20 64 74 79 70 65 20 75 73 65 64 20 74 6f 20 69 6e 69 74 69 61 6c 69 7a 65 20 .NumPy.dtype.used.to.initialize.
1f00 74 68 65 20 61 72 72 61 79 2e 20 4b 65 65 70 20 69 6e 20 6d 69 6e 64 20 63 65 72 74 61 69 6e 0a the.array..Keep.in.mind.certain.
1f20 20 20 20 20 20 20 20 20 64 74 79 70 65 73 20 63 61 6e 20 79 69 65 6c 64 20 75 6e 65 78 70 65 63 ........dtypes.can.yield.unexpec
1f40 74 65 64 20 72 65 73 75 6c 74 73 20 69 66 20 74 68 65 20 61 72 72 61 79 20 69 73 20 74 6f 20 62 ted.results.if.the.array.is.to.b
1f60 65 20 6e 6f 72 6d 61 6c 69 7a 65 64 2e 0a 20 20 20 20 20 20 20 20 54 68 65 20 70 61 72 61 6d 65 e.normalized..........The.parame
1f80 74 65 72 20 69 73 20 70 61 73 73 65 64 20 74 6f 20 6e 75 6d 70 79 2e 7a 65 72 6f 73 28 29 2e 20 ter.is.passed.to.numpy.zeros()..
1fa0 49 66 20 75 6e 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 20 4e 75 6d 50 79 0a 20 20 20 20 20 20 If.unspecified,.the.NumPy.......
1fc0 20 20 64 65 66 61 75 6c 74 20 69 73 20 75 73 65 64 2e 0a 0a 20 20 20 20 6f 72 64 65 72 20 3a 20 ..default.is.used.......order.:.
1fe0 7b 27 43 27 2c 20 27 46 27 7d 2c 20 6f 70 74 69 6f 6e 61 6c 0a 20 20 20 20 20 20 20 20 57 68 65 {'C',.'F'},.optional.........Whe
2000 74 68 65 72 20 74 6f 20 73 74 6f 72 65 20 6d 75 6c 74 69 64 69 6d 65 6e 73 69 6f 6e 61 6c 20 64 ther.to.store.multidimensional.d
2020 61 74 61 20 69 6e 20 43 2d 20 6f 72 20 46 6f 72 74 72 61 6e 2d 63 6f 6e 74 69 67 75 6f 75 73 0a ata.in.C-.or.Fortran-contiguous.
2040 20 20 20 20 20 20 20 20 28 72 6f 77 2d 20 6f 72 20 63 6f 6c 75 6d 6e 2d 77 69 73 65 29 20 6f 72 ........(row-.or.column-wise).or
2060 64 65 72 20 69 6e 20 6d 65 6d 6f 72 79 2e 20 54 68 69 73 20 70 61 72 61 6d 65 74 65 72 20 69 73 der.in.memory..This.parameter.is
2080 20 70 61 73 73 65 64 20 74 6f 0a 20 20 20 20 20 20 20 20 6e 75 6d 70 79 2e 7a 65 72 6f 73 28 29 .passed.to.........numpy.zeros()
20a0 2e 20 49 66 20 75 6e 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 20 4e 75 6d 50 79 20 64 65 66 61 ..If.unspecified,.the.NumPy.defa
20c0 75 6c 74 20 69 73 20 75 73 65 64 2e 0a 0a 20 20 20 20 52 65 74 75 72 6e 73 0a 20 20 20 20 2d 2d ult.is.used.......Returns.....--
20e0 2d 2d 2d 2d 2d 0a 20 20 20 20 4d 20 3a 20 32 44 20 4e 75 6d 50 79 20 6e 64 61 72 72 61 79 0a 20 -----.....M.:.2D.NumPy.ndarray..
2100 20 20 20 20 20 20 20 54 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 61 74 72 69 78 2e 0a 0a 20 20 .......The.attribute.matrix.....
2120 20 20 6f 72 64 65 72 69 6e 67 20 3a 20 6c 69 73 74 0a 20 20 20 20 20 20 20 20 49 66 20 60 72 63 ..ordering.:.list.........If.`rc
2140 5f 6f 72 64 65 72 60 20 77 61 73 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 6f 6e 6c 79 _order`.was.specified,.then.only
2160 20 74 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 61 74 72 69 78 20 69 73 20 72 65 74 75 72 6e 65 .the.attribute.matrix.is.returne
2180 64 2e 0a 20 20 20 20 20 20 20 20 48 6f 77 65 76 65 72 2c 20 69 66 20 60 72 63 5f 6f 72 64 65 72 d..........However,.if.`rc_order
21a0 60 20 77 61 73 20 4e 6f 6e 65 2c 20 74 68 65 6e 20 74 68 65 20 6f 72 64 65 72 69 6e 67 20 75 73 `.was.None,.then.the.ordering.us
21c0 65 64 20 74 6f 20 63 6f 6e 73 74 72 75 63 74 0a 20 20 20 20 20 20 20 20 74 68 65 20 6d 61 74 72 ed.to.construct.........the.matr
21e0 69 78 20 69 73 20 72 65 74 75 72 6e 65 64 20 61 73 20 77 65 6c 6c 2e 0a 0a 20 20 20 20 45 78 61 ix.is.returned.as.well.......Exa
2200 6d 70 6c 65 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 43 6f 6e 73 74 72 75 63 74 mples.....--------.....Construct
2220 20 61 6e 20 61 64 6a 61 63 65 6e 63 79 20 6d 61 74 72 69 78 3a 0a 0a 20 20 20 20 3e 3e 3e 20 47 .an.adjacency.matrix:......>>>.G
2240 20 3d 20 6e 78 2e 47 72 61 70 68 28 29 0a 20 20 20 20 3e 3e 3e 20 47 2e 61 64 64 5f 65 64 67 65 .=.nx.Graph().....>>>.G.add_edge
2260 28 30 2c 20 31 2c 20 74 68 69 63 6b 6e 65 73 73 3d 31 2c 20 77 65 69 67 68 74 3d 33 29 0a 20 20 (0,.1,.thickness=1,.weight=3)...
2280 20 20 3e 3e 3e 20 47 2e 61 64 64 5f 65 64 67 65 28 30 2c 20 32 2c 20 74 68 69 63 6b 6e 65 73 73 ..>>>.G.add_edge(0,.2,.thickness
22a0 3d 32 29 0a 20 20 20 20 3e 3e 3e 20 47 2e 61 64 64 5f 65 64 67 65 28 31 2c 20 32 2c 20 74 68 69 =2).....>>>.G.add_edge(1,.2,.thi
22c0 63 6b 6e 65 73 73 3d 33 29 0a 20 20 20 20 3e 3e 3e 20 6e 78 2e 61 74 74 72 5f 6d 61 74 72 69 78 ckness=3).....>>>.nx.attr_matrix
22e0 28 47 2c 20 72 63 5f 6f 72 64 65 72 3d 5b 30 2c 20 31 2c 20 32 5d 29 0a 20 20 20 20 61 72 72 61 (G,.rc_order=[0,.1,.2]).....arra
2300 79 28 5b 5b 30 2e 2c 20 31 2e 2c 20 31 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 2e 2c y([[0.,.1.,.1.],............[1.,
2320 20 30 2e 2c 20 31 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 2e 2c 20 31 2e 2c 20 30 2e .0.,.1.],............[1.,.1.,.0.
2340 5d 5d 29 0a 0a 20 20 20 20 41 6c 74 65 72 6e 61 74 69 76 65 6c 79 2c 20 77 65 20 63 61 6e 20 6f ]])......Alternatively,.we.can.o
2360 62 74 61 69 6e 20 74 68 65 20 6d 61 74 72 69 78 20 64 65 73 63 72 69 62 69 6e 67 20 65 64 67 65 btain.the.matrix.describing.edge
2380 20 74 68 69 63 6b 6e 65 73 73 2e 0a 0a 20 20 20 20 3e 3e 3e 20 6e 78 2e 61 74 74 72 5f 6d 61 74 .thickness.......>>>.nx.attr_mat
23a0 72 69 78 28 47 2c 20 65 64 67 65 5f 61 74 74 72 3d 22 74 68 69 63 6b 6e 65 73 73 22 2c 20 72 63 rix(G,.edge_attr="thickness",.rc
23c0 5f 6f 72 64 65 72 3d 5b 30 2c 20 31 2c 20 32 5d 29 0a 20 20 20 20 61 72 72 61 79 28 5b 5b 30 2e _order=[0,.1,.2]).....array([[0.
23e0 2c 20 31 2e 2c 20 32 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 2e 2c 20 30 2e 2c 20 33 ,.1.,.2.],............[1.,.0.,.3
2400 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 32 2e 2c 20 33 2e 2c 20 30 2e 5d 5d 29 0a 0a 20 .],............[2.,.3.,.0.]])...
2420 20 20 20 57 65 20 63 61 6e 20 61 6c 73 6f 20 63 6f 6c 6f 72 20 74 68 65 20 6e 6f 64 65 73 20 61 ...We.can.also.color.the.nodes.a
2440 6e 64 20 61 73 6b 20 66 6f 72 20 74 68 65 20 70 72 6f 62 61 62 69 6c 69 74 79 20 64 69 73 74 72 nd.ask.for.the.probability.distr
2460 69 62 75 74 69 6f 6e 20 6f 76 65 72 0a 20 20 20 20 61 6c 6c 20 65 64 67 65 73 20 28 75 2c 76 29 ibution.over.....all.edges.(u,v)
2480 20 64 65 73 63 72 69 62 69 6e 67 3a 0a 0a 20 20 20 20 20 20 20 20 50 72 28 76 20 68 61 73 20 63 .describing:..........Pr(v.has.c
24a0 6f 6c 6f 72 20 59 20 7c 20 75 20 68 61 73 20 63 6f 6c 6f 72 20 58 29 0a 0a 20 20 20 20 3e 3e 3e olor.Y.|.u.has.color.X)......>>>
24c0 20 47 2e 6e 6f 64 65 73 5b 30 5d 5b 22 63 6f 6c 6f 72 22 5d 20 3d 20 22 72 65 64 22 0a 20 20 20 .G.nodes[0]["color"].=."red"....
24e0 20 3e 3e 3e 20 47 2e 6e 6f 64 65 73 5b 31 5d 5b 22 63 6f 6c 6f 72 22 5d 20 3d 20 22 72 65 64 22 .>>>.G.nodes[1]["color"].=."red"
2500 0a 20 20 20 20 3e 3e 3e 20 47 2e 6e 6f 64 65 73 5b 32 5d 5b 22 63 6f 6c 6f 72 22 5d 20 3d 20 22 .....>>>.G.nodes[2]["color"].=."
2520 62 6c 75 65 22 0a 20 20 20 20 3e 3e 3e 20 72 63 20 3d 20 5b 22 72 65 64 22 2c 20 22 62 6c 75 65 blue".....>>>.rc.=.["red",."blue
2540 22 5d 0a 20 20 20 20 3e 3e 3e 20 6e 78 2e 61 74 74 72 5f 6d 61 74 72 69 78 28 47 2c 20 6e 6f 64 "].....>>>.nx.attr_matrix(G,.nod
2560 65 5f 61 74 74 72 3d 22 63 6f 6c 6f 72 22 2c 20 6e 6f 72 6d 61 6c 69 7a 65 64 3d 54 72 75 65 2c e_attr="color",.normalized=True,
2580 20 72 63 5f 6f 72 64 65 72 3d 72 63 29 0a 20 20 20 20 61 72 72 61 79 28 5b 5b 30 2e 33 33 33 33 .rc_order=rc).....array([[0.3333
25a0 33 33 33 33 2c 20 30 2e 36 36 36 36 36 36 36 37 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 3333,.0.66666667],............[1
25c0 2e 20 20 20 20 20 20 20 20 2c 20 30 2e 20 20 20 20 20 20 20 20 5d 5d 29 0a 0a 20 20 20 20 46 6f .........,.0.........]])......Fo
25e0 72 20 65 78 61 6d 70 6c 65 2c 20 74 68 65 20 61 62 6f 76 65 20 74 65 6c 6c 73 20 75 73 20 74 68 r.example,.the.above.tells.us.th
2600 61 74 20 66 6f 72 20 61 6c 6c 20 65 64 67 65 73 20 28 75 2c 76 29 3a 0a 0a 20 20 20 20 20 20 20 at.for.all.edges.(u,v):.........
2620 20 50 72 28 20 76 20 69 73 20 72 65 64 20 20 7c 20 75 20 69 73 20 72 65 64 29 20 20 3d 20 31 2f .Pr(.v.is.red..|.u.is.red)..=.1/
2640 33 0a 20 20 20 20 20 20 20 20 50 72 28 20 76 20 69 73 20 62 6c 75 65 20 7c 20 75 20 69 73 20 72 3.........Pr(.v.is.blue.|.u.is.r
2660 65 64 29 20 20 3d 20 32 2f 33 0a 0a 20 20 20 20 20 20 20 20 50 72 28 20 76 20 69 73 20 72 65 64 ed)..=.2/3..........Pr(.v.is.red
2680 20 20 7c 20 75 20 69 73 20 62 6c 75 65 29 20 3d 20 31 0a 20 20 20 20 20 20 20 20 50 72 28 20 76 ..|.u.is.blue).=.1.........Pr(.v
26a0 20 69 73 20 62 6c 75 65 20 7c 20 75 20 69 73 20 62 6c 75 65 29 20 3d 20 30 0a 0a 20 20 20 20 46 .is.blue.|.u.is.blue).=.0......F
26c0 69 6e 61 6c 6c 79 2c 20 77 65 20 63 61 6e 20 6f 62 74 61 69 6e 20 74 68 65 20 74 6f 74 61 6c 20 inally,.we.can.obtain.the.total.
26e0 77 65 69 67 68 74 73 20 6c 69 73 74 65 64 20 62 79 20 74 68 65 20 6e 6f 64 65 20 63 6f 6c 6f 72 weights.listed.by.the.node.color
2700 73 2e 0a 0a 20 20 20 20 3e 3e 3e 20 6e 78 2e 61 74 74 72 5f 6d 61 74 72 69 78 28 47 2c 20 65 64 s.......>>>.nx.attr_matrix(G,.ed
2720 67 65 5f 61 74 74 72 3d 22 77 65 69 67 68 74 22 2c 20 6e 6f 64 65 5f 61 74 74 72 3d 22 63 6f 6c ge_attr="weight",.node_attr="col
2740 6f 72 22 2c 20 72 63 5f 6f 72 64 65 72 3d 72 63 29 0a 20 20 20 20 61 72 72 61 79 28 5b 5b 33 2e or",.rc_order=rc).....array([[3.
2760 2c 20 32 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 32 2e 2c 20 30 2e 5d 5d 29 0a 0a 20 20 ,.2.],............[2.,.0.]])....
2780 20 20 54 68 75 73 2c 20 74 68 65 20 74 6f 74 61 6c 20 77 65 69 67 68 74 20 6f 76 65 72 20 61 6c ..Thus,.the.total.weight.over.al
27a0 6c 20 65 64 67 65 73 20 28 75 2c 76 29 20 77 69 74 68 20 75 20 61 6e 64 20 76 20 68 61 76 69 6e l.edges.(u,v).with.u.and.v.havin
27c0 67 20 63 6f 6c 6f 72 73 3a 0a 0a 20 20 20 20 20 20 20 20 28 72 65 64 2c 20 72 65 64 29 20 20 20 g.colors:..........(red,.red)...
27e0 69 73 20 33 20 20 20 23 20 74 68 65 20 73 6f 6c 65 20 63 6f 6e 74 72 69 62 75 74 69 6f 6e 20 69 is.3...#.the.sole.contribution.i
2800 73 20 66 72 6f 6d 20 65 64 67 65 20 28 30 2c 31 29 0a 20 20 20 20 20 20 20 20 28 72 65 64 2c 20 s.from.edge.(0,1).........(red,.
2820 62 6c 75 65 29 20 20 69 73 20 32 20 20 20 23 20 63 6f 6e 74 72 69 62 75 74 69 6f 6e 73 20 66 72 blue)..is.2...#.contributions.fr
2840 6f 6d 20 65 64 67 65 73 20 28 30 2c 32 29 20 61 6e 64 20 28 31 2c 32 29 0a 20 20 20 20 20 20 20 om.edges.(0,2).and.(1,2)........
2860 20 28 62 6c 75 65 2c 20 72 65 64 29 20 20 69 73 20 32 20 20 20 23 20 73 61 6d 65 20 61 73 20 28 .(blue,.red)..is.2...#.same.as.(
2880 72 65 64 2c 20 62 6c 75 65 29 20 73 69 6e 63 65 20 67 72 61 70 68 20 69 73 20 75 6e 64 69 72 65 red,.blue).since.graph.is.undire
28a0 63 74 65 64 0a 20 20 20 20 20 20 20 20 28 62 6c 75 65 2c 20 62 6c 75 65 29 20 69 73 20 30 20 20 cted.........(blue,.blue).is.0..
28c0 20 23 20 74 68 65 72 65 20 61 72 65 20 6e 6f 20 65 64 67 65 73 20 77 69 74 68 20 62 6c 75 65 20 .#.there.are.no.edges.with.blue.
28e0 65 6e 64 70 6f 69 6e 74 73 0a 0a 20 20 20 20 72 02 00 00 00 4e 29 02 da 05 64 74 79 70 65 da 05 endpoints......r....N)...dtype..
2900 6f 72 64 65 72 72 19 00 00 00 a9 01 da 04 61 78 69 73 29 0f da 05 6e 75 6d 70 79 72 2d 00 00 00 orderr........axis)...numpyr-...
2920 72 12 00 00 00 da 04 6c 69 73 74 72 15 00 00 00 da 0b 69 73 5f 64 69 72 65 63 74 65 64 da 04 64 r......listr......is_directed..d
2940 69 63 74 da 03 7a 69 70 da 05 72 61 6e 67 65 da 05 7a 65 72 6f 73 da 03 73 65 74 da 09 61 64 6a ict..zip..range..zeros..set..adj
2960 61 63 65 6e 63 79 da 03 61 64 64 72 25 00 00 00 da 07 72 65 73 68 61 70 65 29 16 72 0f 00 00 00 acency..addr%.....reshape).r....
2980 72 22 00 00 00 72 10 00 00 00 da 0a 6e 6f 72 6d 61 6c 69 7a 65 64 da 08 72 63 5f 6f 72 64 65 72 r"...r......normalized..rc_order
29a0 72 31 00 00 00 72 32 00 00 00 da 02 6e 70 da 0a 65 64 67 65 5f 76 61 6c 75 65 da 0a 6e 6f 64 65 r1...r2.....np..edge_value..node
29c0 5f 76 61 6c 75 65 da 01 6e da 08 6f 72 64 65 72 69 6e 67 da 01 4e da 0a 75 6e 64 69 72 65 63 74 _value..n..ordering..N..undirect
29e0 65 64 da 05 69 6e 64 65 78 da 01 4d da 04 73 65 65 6e 72 09 00 00 00 da 07 6e 62 72 64 69 63 74 ed..index..M..seenr......nbrdict
2a00 72 16 00 00 00 da 01 69 da 01 6a 73 16 00 00 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r......i..js....................
2a20 20 20 20 20 20 20 72 0a 00 00 00 72 03 00 00 00 72 03 00 00 00 92 00 00 00 73 5c 01 00 00 80 00 ......r....r....r........s\.....
2a40 f3 40 04 00 05 17 e4 11 1c 98 51 a0 09 d3 11 2a 80 4a dc 11 1c 98 51 a0 09 d3 11 2a 80 4a e0 07 .@........Q....*.J....Q....*.J..
2a60 0f d0 07 17 dc 13 17 b0 01 d6 18 32 a8 31 99 1a a0 41 9d 1d d2 18 32 d3 13 33 89 08 e0 13 1b 88 ...........2.1...A....2..3......
2a80 08 e4 08 0b 88 48 8b 0d 80 41 d8 15 16 97 5d 91 5d 93 5f d0 11 24 80 4a dc 0c 10 94 13 90 58 9c .....H...A....].]._..$.J......X.
2aa0 75 a0 51 9b 78 d3 11 28 d3 0c 29 80 45 d8 08 0a 8f 08 89 08 90 21 90 51 90 16 98 75 a8 45 88 08 u.Q.x..(..).E........!.Q...u.E..
2ac0 d3 08 32 80 41 e4 0b 0e 8b 35 80 44 d8 16 17 97 6b 91 6b 93 6d f2 00 0a 05 18 89 0a 88 01 88 37 ..2.A....5.D....k.k.m..........7
2ae0 d8 11 18 f2 00 06 09 26 88 41 e0 13 18 99 1a a0 41 9b 1d d1 13 27 a8 15 a9 7a b8 21 ab 7d d1 29 .......&.A......A....'...z.!.}.)
2b00 3d 88 71 88 41 d8 0f 10 98 04 8a 7d d8 10 11 90 21 90 51 90 24 93 07 99 3a a0 61 a8 11 d3 1b 2b =.q.A......}....!.Q.$...:.a....+
2b20 d1 10 2b 93 07 da 13 1d d8 1e 1f a0 01 a0 31 a0 04 99 67 90 41 90 61 98 11 90 64 92 47 f0 0d 06 ..+...........1...g.A.a...d.G...
2b40 09 26 f2 10 00 0c 16 d8 0c 10 8f 48 89 48 90 51 8d 4b f0 15 0a 05 18 f1 18 00 08 12 d8 08 09 88 .&.........H.H.Q.K..............
2b60 51 8f 55 89 55 98 01 88 55 8b 5d d7 0d 22 d1 0d 22 a0 41 a0 71 a0 36 d3 0d 2a d1 08 2a 88 01 e0 Q.U.U...U.].."..".A.q.6..*..*...
2b80 07 0f d0 07 17 d8 0f 10 90 28 88 7b d0 08 1a e0 0f 10 88 08 f9 f2 39 00 19 33 73 05 00 00 00 a8 .........(.{..........9..3s.....
2ba0 0f 44 3e 08 63 06 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 03 00 00 00 f3 a6 02 00 00 97 00 .D>.c...........................
2bc0 64 01 64 02 6c 00 7d 06 64 01 64 02 6c 01 7d 07 74 05 00 00 00 00 00 00 00 00 7c 00 7c 01 ab 02 d.d.l.}.d.d.l.}.t.........|.|...
2be0 00 00 00 00 00 00 7d 08 74 07 00 00 00 00 00 00 00 00 7c 00 7c 02 ab 02 00 00 00 00 00 00 7d 09 ......}.t.........|.|.........}.
2c00 7c 04 80 20 74 09 00 00 00 00 00 00 00 00 7c 00 44 00 8f 0a 63 02 68 00 63 02 5d 0a 00 00 7d 0a |...t.........|.D...c.h.c.]...}.
2c20 02 00 7c 09 7c 0a ab 01 00 00 00 00 00 00 92 02 8c 0c 04 00 63 02 7d 0a ab 01 00 00 00 00 00 00 ..|.|...............c.}.........
2c40 7d 0b 6e 02 7c 04 7d 0b 74 0b 00 00 00 00 00 00 00 00 7c 0b ab 01 00 00 00 00 00 00 7d 0c 7c 00 }.n.|.}.t.........|.........}.|.
2c60 6a 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ab 00 00 00 00 00 00 00 0c 00 7d 0d j.............................}.
2c80 74 0f 00 00 00 00 00 00 00 00 74 11 00 00 00 00 00 00 00 00 7c 0b 74 13 00 00 00 00 00 00 00 00 t.........t.........|.t.........
2ca0 7c 0c ab 01 00 00 00 00 00 00 ab 02 00 00 00 00 00 00 ab 01 00 00 00 00 00 00 7d 0e 7c 07 6a 14 |.........................}.|.j.
2cc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6a 17 00 00 00 00 00 00 00 00 00 00 00 00 ..................j.............
2ce0 00 00 00 00 00 00 7c 0c 7c 0c 66 02 7c 05 ac 03 ab 02 00 00 00 00 00 00 7d 0f 74 19 00 00 00 00 ......|.|.f.|...........}.t.....
2d00 00 00 00 00 ab 00 00 00 00 00 00 00 7d 10 7c 00 6a 1b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............}.|.j...............
2d20 00 00 00 00 ab 00 00 00 00 00 00 00 44 00 5d 60 00 00 5c 02 00 00 7d 11 7d 12 7c 12 44 00 5d 42 ............D.]`..\...}.}.|.D.]B
2d40 00 00 7d 13 7c 0e 02 00 7c 09 7c 11 ab 01 00 00 00 00 00 00 19 00 00 00 7c 0e 02 00 7c 09 7c 13 ..}.|...|.|.............|...|.|.
2d60 ab 01 00 00 00 00 00 00 19 00 00 00 7d 15 7d 14 7c 13 7c 10 76 01 73 01 8c 1e 7c 0f 7c 14 7c 15 ............}.}.|.|.v.s...|.|.|.
2d80 66 02 78 02 78 02 19 00 00 00 02 00 7c 08 7c 11 7c 13 ab 02 00 00 00 00 00 00 7a 0d 00 00 63 03 f.x.x.......|.|.|.........z...c.
2da0 63 02 3c 00 00 00 7c 0d 73 01 8c 37 7c 0f 7c 14 7c 15 66 02 19 00 00 00 7c 0f 7c 15 7c 14 66 02 c.<...|.s..7|.|.|.f.....|.|.|.f.
2dc0 3c 00 00 00 8c 44 04 00 7c 0d 73 01 8c 50 7c 10 6a 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <....D..|.s..P|.j...............
2de0 00 00 00 00 7c 11 ab 01 00 00 00 00 00 00 01 00 8c 62 04 00 7c 03 72 29 7c 0f 64 04 7c 0f 6a 1f ....|............b..|.r)|.d.|.j.
2e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 04 ac 05 ab 01 00 00 00 00 00 00 64 02 ..................d...........d.
2e20 64 02 85 02 7c 06 6a 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 66 02 19 00 00 00 d...|.j...................f.....
2e40 7a 0b 00 00 7a 12 00 00 7d 0f 7c 04 80 04 7c 0f 7c 0b 66 02 53 00 7c 0f 53 00 63 02 01 00 63 02 z...z...}.|...|.|.f.S.|.S.c...c.
2e60 7d 0a 77 00 29 06 61 c9 11 00 00 52 65 74 75 72 6e 73 20 61 20 53 63 69 50 79 20 73 70 61 72 73 }.w.).a....Returns.a.SciPy.spars
2e80 65 20 61 72 72 61 79 20 75 73 69 6e 67 20 61 74 74 72 69 62 75 74 65 73 20 66 72 6f 6d 20 47 2e e.array.using.attributes.from.G.
2ea0 0a 0a 20 20 20 20 49 66 20 6f 6e 6c 79 20 60 47 60 20 69 73 20 70 61 73 73 65 64 20 69 6e 2c 20 ......If.only.`G`.is.passed.in,.
2ec0 74 68 65 6e 20 74 68 65 20 61 64 6a 61 63 65 6e 63 79 20 6d 61 74 72 69 78 20 69 73 20 63 6f 6e then.the.adjacency.matrix.is.con
2ee0 73 74 72 75 63 74 65 64 2e 0a 0a 20 20 20 20 4c 65 74 20 41 20 62 65 20 61 20 64 69 73 63 72 65 structed.......Let.A.be.a.discre
2f00 74 65 20 73 65 74 20 6f 66 20 76 61 6c 75 65 73 20 66 6f 72 20 74 68 65 20 6e 6f 64 65 20 61 74 te.set.of.values.for.the.node.at
2f20 74 72 69 62 75 74 65 20 60 6e 6f 64 65 5f 61 74 74 72 60 2e 20 54 68 65 6e 0a 20 20 20 20 74 68 tribute.`node_attr`..Then.....th
2f40 65 20 65 6c 65 6d 65 6e 74 73 20 6f 66 20 41 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 20 72 6f e.elements.of.A.represent.the.ro
2f60 77 73 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 6f 66 20 74 68 65 20 63 6f 6e 73 74 72 75 63 74 65 ws.and.columns.of.the.constructe
2f80 64 20 6d 61 74 72 69 78 2e 0a 20 20 20 20 4e 6f 77 2c 20 69 74 65 72 61 74 65 20 74 68 72 6f 75 d.matrix......Now,.iterate.throu
2fa0 67 68 20 65 76 65 72 79 20 65 64 67 65 20 65 3d 28 75 2c 76 29 20 69 6e 20 60 47 60 20 61 6e 64 gh.every.edge.e=(u,v).in.`G`.and
2fc0 20 63 6f 6e 73 69 64 65 72 20 74 68 65 20 76 61 6c 75 65 0a 20 20 20 20 6f 66 20 74 68 65 20 65 .consider.the.value.....of.the.e
2fe0 64 67 65 20 61 74 74 72 69 62 75 74 65 20 60 65 64 67 65 5f 61 74 74 72 60 2e 20 20 49 66 20 75 dge.attribute.`edge_attr`...If.u
3000 61 20 61 6e 64 20 76 61 20 61 72 65 20 74 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 68 65 0a 20 a.and.va.are.the.values.of.the..
3020 20 20 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 20 60 6e 6f 64 65 5f 61 74 74 72 60 20 66 6f ...node.attribute.`node_attr`.fo
3040 72 20 75 20 61 6e 64 20 76 2c 20 72 65 73 70 65 63 74 69 76 65 6c 79 2c 20 74 68 65 6e 20 74 68 r.u.and.v,.respectively,.then.th
3060 65 20 76 61 6c 75 65 20 6f 66 0a 20 20 20 20 74 68 65 20 65 64 67 65 20 61 74 74 72 69 62 75 74 e.value.of.....the.edge.attribut
3080 65 20 69 73 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 6d 61 74 72 69 78 20 65 6c 65 6d 65 6e 74 e.is.added.to.the.matrix.element
30a0 20 61 74 20 28 75 61 2c 20 76 61 29 2e 0a 0a 20 20 20 20 50 61 72 61 6d 65 74 65 72 73 0a 20 20 .at.(ua,.va).......Parameters...
30c0 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 47 20 3a 20 67 72 61 70 68 0a 20 20 20 20 20 ..----------.....G.:.graph......
30e0 20 20 20 54 68 65 20 4e 65 74 77 6f 72 6b 58 20 67 72 61 70 68 20 75 73 65 64 20 74 6f 20 63 6f ...The.NetworkX.graph.used.to.co
3100 6e 73 74 72 75 63 74 20 74 68 65 20 4e 75 6d 50 79 20 6d 61 74 72 69 78 2e 0a 0a 20 20 20 20 65 nstruct.the.NumPy.matrix.......e
3120 64 67 65 5f 61 74 74 72 20 3a 20 73 74 72 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c dge_attr.:.str,.optional.(defaul
3140 74 3a 20 6e 75 6d 62 65 72 20 6f 66 20 65 64 67 65 73 20 66 6f 72 20 65 61 63 68 20 6d 61 74 72 t:.number.of.edges.for.each.matr
3160 69 78 20 65 6c 65 6d 65 6e 74 29 0a 20 20 20 20 20 20 20 20 45 61 63 68 20 65 6c 65 6d 65 6e 74 ix.element).........Each.element
3180 20 6f 66 20 74 68 65 20 6d 61 74 72 69 78 20 72 65 70 72 65 73 65 6e 74 73 20 61 20 72 75 6e 6e .of.the.matrix.represents.a.runn
31a0 69 6e 67 20 74 6f 74 61 6c 20 6f 66 20 74 68 65 0a 20 20 20 20 20 20 20 20 73 70 65 63 69 66 69 ing.total.of.the.........specifi
31c0 65 64 20 65 64 67 65 20 61 74 74 72 69 62 75 74 65 20 66 6f 72 20 65 64 67 65 73 20 77 68 6f 73 ed.edge.attribute.for.edges.whos
31e0 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 0a 20 20 20 e.node.attributes.correspond....
3200 20 20 20 20 20 74 6f 20 74 68 65 20 72 6f 77 73 2f 63 6f 6c 73 20 6f 66 20 74 68 65 20 6d 61 74 .....to.the.rows/cols.of.the.mat
3220 72 69 78 2e 20 54 68 65 20 61 74 74 72 69 62 75 74 65 20 6d 75 73 74 20 62 65 20 70 72 65 73 65 rix..The.attribute.must.be.prese
3240 6e 74 20 66 6f 72 0a 20 20 20 20 20 20 20 20 61 6c 6c 20 65 64 67 65 73 20 69 6e 20 74 68 65 20 nt.for.........all.edges.in.the.
3260 67 72 61 70 68 2e 20 49 66 20 6e 6f 20 61 74 74 72 69 62 75 74 65 20 69 73 20 73 70 65 63 69 66 graph..If.no.attribute.is.specif
3280 69 65 64 2c 20 74 68 65 6e 20 77 65 0a 20 20 20 20 20 20 20 20 6a 75 73 74 20 63 6f 75 6e 74 20 ied,.then.we.........just.count.
32a0 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 64 67 65 73 20 77 68 6f 73 65 20 6e 6f 64 65 20 61 the.number.of.edges.whose.node.a
32c0 74 74 72 69 62 75 74 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 0a 20 20 20 20 20 20 20 20 74 6f 20 ttributes.correspond.........to.
32e0 74 68 65 20 6d 61 74 72 69 78 20 65 6c 65 6d 65 6e 74 2e 0a 0a 20 20 20 20 6e 6f 64 65 5f 61 74 the.matrix.element.......node_at
3300 74 72 20 3a 20 73 74 72 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a 20 75 73 65 tr.:.str,.optional.(default:.use
3320 20 6e 6f 64 65 73 20 6f 66 20 74 68 65 20 67 72 61 70 68 29 0a 20 20 20 20 20 20 20 20 45 61 63 .nodes.of.the.graph).........Eac
3340 68 20 72 6f 77 20 61 6e 64 20 63 6f 6c 75 6d 6e 20 69 6e 20 74 68 65 20 6d 61 74 72 69 78 20 72 h.row.and.column.in.the.matrix.r
3360 65 70 72 65 73 65 6e 74 73 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 76 61 6c 75 65 0a 20 20 20 epresents.a.particular.value....
3380 20 20 20 20 20 6f 66 20 74 68 65 20 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 2e 20 20 54 68 65 .....of.the.node.attribute...The
33a0 20 61 74 74 72 69 62 75 74 65 20 6d 75 73 74 20 62 65 20 70 72 65 73 65 6e 74 20 66 6f 72 20 61 .attribute.must.be.present.for.a
33c0 6c 6c 20 6e 6f 64 65 73 0a 20 20 20 20 20 20 20 20 69 6e 20 74 68 65 20 67 72 61 70 68 2e 20 4e ll.nodes.........in.the.graph..N
33e0 6f 74 65 2c 20 74 68 65 20 76 61 6c 75 65 73 20 6f 66 20 74 68 69 73 20 61 74 74 72 69 62 75 74 ote,.the.values.of.this.attribut
3400 65 20 73 68 6f 75 6c 64 20 62 65 20 72 65 6c 69 61 62 6c 79 0a 20 20 20 20 20 20 20 20 68 61 73 e.should.be.reliably.........has
3420 68 61 62 6c 65 2e 20 53 6f 2c 20 66 6c 6f 61 74 20 76 61 6c 75 65 73 20 61 72 65 20 6e 6f 74 20 hable..So,.float.values.are.not.
3440 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 49 66 20 6e 6f 20 61 74 74 72 69 62 75 74 65 20 69 73 0a recommended..If.no.attribute.is.
3460 20 20 20 20 20 20 20 20 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 74 68 65 20 72 6f 77 73 ........specified,.then.the.rows
3480 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 77 69 6c 6c 20 62 65 20 74 68 65 20 6e 6f 64 65 73 20 6f .and.columns.will.be.the.nodes.o
34a0 66 20 74 68 65 20 67 72 61 70 68 2e 0a 0a 20 20 20 20 6e 6f 72 6d 61 6c 69 7a 65 64 20 3a 20 62 f.the.graph.......normalized.:.b
34c0 6f 6f 6c 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a 20 46 61 6c 73 65 29 0a 20 ool,.optional.(default:.False)..
34e0 20 20 20 20 20 20 20 49 66 20 54 72 75 65 2c 20 74 68 65 6e 20 65 61 63 68 20 72 6f 77 20 69 73 .......If.True,.then.each.row.is
3500 20 6e 6f 72 6d 61 6c 69 7a 65 64 20 62 79 20 74 68 65 20 73 75 6d 6d 61 74 69 6f 6e 20 6f 66 20 .normalized.by.the.summation.of.
3520 69 74 73 20 76 61 6c 75 65 73 2e 0a 0a 20 20 20 20 72 63 5f 6f 72 64 65 72 20 3a 20 6c 69 73 74 its.values.......rc_order.:.list
3540 2c 20 6f 70 74 69 6f 6e 61 6c 20 28 64 65 66 61 75 6c 74 3a 20 6f 72 64 65 72 20 6f 66 20 6e 6f ,.optional.(default:.order.of.no
3560 64 65 73 20 69 6e 20 47 29 0a 20 20 20 20 20 20 20 20 41 20 6c 69 73 74 20 6f 66 20 74 68 65 20 des.in.G).........A.list.of.the.
3580 6e 6f 64 65 20 61 74 74 72 69 62 75 74 65 20 76 61 6c 75 65 73 2e 20 54 68 69 73 20 6c 69 73 74 node.attribute.values..This.list
35a0 20 73 70 65 63 69 66 69 65 73 20 74 68 65 20 6f 72 64 65 72 69 6e 67 0a 20 20 20 20 20 20 20 20 .specifies.the.ordering.........
35c0 6f 66 20 72 6f 77 73 20 61 6e 64 20 63 6f 6c 75 6d 6e 73 20 6f 66 20 74 68 65 20 61 72 72 61 79 of.rows.and.columns.of.the.array
35e0 20 61 6e 64 20 74 68 65 20 72 65 74 75 72 6e 20 76 61 6c 75 65 2e 20 49 66 20 6e 6f 20 6f 72 64 .and.the.return.value..If.no.ord
3600 65 72 69 6e 67 0a 20 20 20 20 20 20 20 20 69 73 20 70 72 6f 76 69 64 65 64 2c 20 74 68 65 6e 20 ering.........is.provided,.then.
3620 74 68 65 20 6f 72 64 65 72 69 6e 67 20 77 69 6c 6c 20 62 65 20 74 68 61 74 20 6f 66 20 6e 6f 64 the.ordering.will.be.that.of.nod
3640 65 73 20 69 6e 20 60 47 60 2e 0a 0a 20 20 20 20 4f 74 68 65 72 20 50 61 72 61 6d 65 74 65 72 73 es.in.`G`.......Other.Parameters
3660 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 64 74 79 70 65 20 .....----------------.....dtype.
3680 3a 20 4e 75 6d 50 79 20 64 61 74 61 2d 74 79 70 65 2c 20 6f 70 74 69 6f 6e 61 6c 0a 20 20 20 20 :.NumPy.data-type,.optional.....
36a0 20 20 20 20 41 20 76 61 6c 69 64 20 4e 75 6d 50 79 20 64 74 79 70 65 20 75 73 65 64 20 74 6f 20 ....A.valid.NumPy.dtype.used.to.
36c0 69 6e 69 74 69 61 6c 69 7a 65 20 74 68 65 20 61 72 72 61 79 2e 20 4b 65 65 70 20 69 6e 20 6d 69 initialize.the.array..Keep.in.mi
36e0 6e 64 20 63 65 72 74 61 69 6e 0a 20 20 20 20 20 20 20 20 64 74 79 70 65 73 20 63 61 6e 20 79 69 nd.certain.........dtypes.can.yi
3700 65 6c 64 20 75 6e 65 78 70 65 63 74 65 64 20 72 65 73 75 6c 74 73 20 69 66 20 74 68 65 20 61 72 eld.unexpected.results.if.the.ar
3720 72 61 79 20 69 73 20 74 6f 20 62 65 20 6e 6f 72 6d 61 6c 69 7a 65 64 2e 0a 20 20 20 20 20 20 20 ray.is.to.be.normalized.........
3740 20 54 68 65 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 70 61 73 73 65 64 20 74 6f 20 6e 75 6d 70 .The.parameter.is.passed.to.nump
3760 79 2e 7a 65 72 6f 73 28 29 2e 20 49 66 20 75 6e 73 70 65 63 69 66 69 65 64 2c 20 74 68 65 20 4e y.zeros()..If.unspecified,.the.N
3780 75 6d 50 79 0a 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 20 69 73 20 75 73 65 64 2e 0a 0a 20 umPy.........default.is.used....
37a0 20 20 20 52 65 74 75 72 6e 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 4d 20 3a 20 53 ...Returns.....-------.....M.:.S
37c0 63 69 50 79 20 73 70 61 72 73 65 20 61 72 72 61 79 0a 20 20 20 20 20 20 20 20 54 68 65 20 61 74 ciPy.sparse.array.........The.at
37e0 74 72 69 62 75 74 65 20 6d 61 74 72 69 78 2e 0a 0a 20 20 20 20 6f 72 64 65 72 69 6e 67 20 3a 20 tribute.matrix.......ordering.:.
3800 6c 69 73 74 0a 20 20 20 20 20 20 20 20 49 66 20 60 72 63 5f 6f 72 64 65 72 60 20 77 61 73 20 73 list.........If.`rc_order`.was.s
3820 70 65 63 69 66 69 65 64 2c 20 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20 6d 61 74 72 69 78 20 69 pecified,.then.only.the.matrix.i
3840 73 20 72 65 74 75 72 6e 65 64 2e 0a 20 20 20 20 20 20 20 20 48 6f 77 65 76 65 72 2c 20 69 66 20 s.returned..........However,.if.
3860 60 72 63 5f 6f 72 64 65 72 60 20 77 61 73 20 4e 6f 6e 65 2c 20 74 68 65 6e 20 74 68 65 20 6f 72 `rc_order`.was.None,.then.the.or
3880 64 65 72 69 6e 67 20 75 73 65 64 20 74 6f 20 63 6f 6e 73 74 72 75 63 74 0a 20 20 20 20 20 20 20 dering.used.to.construct........
38a0 20 74 68 65 20 6d 61 74 72 69 78 20 69 73 20 72 65 74 75 72 6e 65 64 20 61 73 20 77 65 6c 6c 2e .the.matrix.is.returned.as.well.
38c0 0a 0a 20 20 20 20 45 78 61 6d 70 6c 65 73 0a 20 20 20 20 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20 20 20 ......Examples.....--------.....
38e0 43 6f 6e 73 74 72 75 63 74 20 61 6e 20 61 64 6a 61 63 65 6e 63 79 20 6d 61 74 72 69 78 3a 0a 0a Construct.an.adjacency.matrix:..
3900 20 20 20 20 3e 3e 3e 20 47 20 3d 20 6e 78 2e 47 72 61 70 68 28 29 0a 20 20 20 20 3e 3e 3e 20 47 ....>>>.G.=.nx.Graph().....>>>.G
3920 2e 61 64 64 5f 65 64 67 65 28 30 2c 20 31 2c 20 74 68 69 63 6b 6e 65 73 73 3d 31 2c 20 77 65 69 .add_edge(0,.1,.thickness=1,.wei
3940 67 68 74 3d 33 29 0a 20 20 20 20 3e 3e 3e 20 47 2e 61 64 64 5f 65 64 67 65 28 30 2c 20 32 2c 20 ght=3).....>>>.G.add_edge(0,.2,.
3960 74 68 69 63 6b 6e 65 73 73 3d 32 29 0a 20 20 20 20 3e 3e 3e 20 47 2e 61 64 64 5f 65 64 67 65 28 thickness=2).....>>>.G.add_edge(
3980 31 2c 20 32 2c 20 74 68 69 63 6b 6e 65 73 73 3d 33 29 0a 20 20 20 20 3e 3e 3e 20 4d 20 3d 20 6e 1,.2,.thickness=3).....>>>.M.=.n
39a0 78 2e 61 74 74 72 5f 73 70 61 72 73 65 5f 6d 61 74 72 69 78 28 47 2c 20 72 63 5f 6f 72 64 65 72 x.attr_sparse_matrix(G,.rc_order
39c0 3d 5b 30 2c 20 31 2c 20 32 5d 29 0a 20 20 20 20 3e 3e 3e 20 4d 2e 74 6f 61 72 72 61 79 28 29 0a =[0,.1,.2]).....>>>.M.toarray().
39e0 20 20 20 20 61 72 72 61 79 28 5b 5b 30 2e 2c 20 31 2e 2c 20 31 2e 5d 2c 0a 20 20 20 20 20 20 20 ....array([[0.,.1.,.1.],........
3a00 20 20 20 20 5b 31 2e 2c 20 30 2e 2c 20 31 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 2e ....[1.,.0.,.1.],............[1.
3a20 2c 20 31 2e 2c 20 30 2e 5d 5d 29 0a 0a 20 20 20 20 41 6c 74 65 72 6e 61 74 69 76 65 6c 79 2c 20 ,.1.,.0.]])......Alternatively,.
3a40 77 65 20 63 61 6e 20 6f 62 74 61 69 6e 20 74 68 65 20 6d 61 74 72 69 78 20 64 65 73 63 72 69 62 we.can.obtain.the.matrix.describ
3a60 69 6e 67 20 65 64 67 65 20 74 68 69 63 6b 6e 65 73 73 2e 0a 0a 20 20 20 20 3e 3e 3e 20 4d 20 3d ing.edge.thickness.......>>>.M.=
3a80 20 6e 78 2e 61 74 74 72 5f 73 70 61 72 73 65 5f 6d 61 74 72 69 78 28 47 2c 20 65 64 67 65 5f 61 .nx.attr_sparse_matrix(G,.edge_a
3aa0 74 74 72 3d 22 74 68 69 63 6b 6e 65 73 73 22 2c 20 72 63 5f 6f 72 64 65 72 3d 5b 30 2c 20 31 2c ttr="thickness",.rc_order=[0,.1,
3ac0 20 32 5d 29 0a 20 20 20 20 3e 3e 3e 20 4d 2e 74 6f 61 72 72 61 79 28 29 0a 20 20 20 20 61 72 72 .2]).....>>>.M.toarray().....arr
3ae0 61 79 28 5b 5b 30 2e 2c 20 31 2e 2c 20 32 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 31 2e ay([[0.,.1.,.2.],............[1.
3b00 2c 20 30 2e 2c 20 33 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 32 2e 2c 20 33 2e 2c 20 30 ,.0.,.3.],............[2.,.3.,.0
3b20 2e 5d 5d 29 0a 0a 20 20 20 20 57 65 20 63 61 6e 20 61 6c 73 6f 20 63 6f 6c 6f 72 20 74 68 65 20 .]])......We.can.also.color.the.
3b40 6e 6f 64 65 73 20 61 6e 64 20 61 73 6b 20 66 6f 72 20 74 68 65 20 70 72 6f 62 61 62 69 6c 69 74 nodes.and.ask.for.the.probabilit
3b60 79 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 76 65 72 0a 20 20 20 20 61 6c 6c 20 65 64 67 65 y.distribution.over.....all.edge
3b80 73 20 28 75 2c 76 29 20 64 65 73 63 72 69 62 69 6e 67 3a 0a 0a 20 20 20 20 20 20 20 20 50 72 28 s.(u,v).describing:..........Pr(
3ba0 76 20 68 61 73 20 63 6f 6c 6f 72 20 59 20 7c 20 75 20 68 61 73 20 63 6f 6c 6f 72 20 58 29 0a 0a v.has.color.Y.|.u.has.color.X)..
3bc0 20 20 20 20 3e 3e 3e 20 47 2e 6e 6f 64 65 73 5b 30 5d 5b 22 63 6f 6c 6f 72 22 5d 20 3d 20 22 72 ....>>>.G.nodes[0]["color"].=."r
3be0 65 64 22 0a 20 20 20 20 3e 3e 3e 20 47 2e 6e 6f 64 65 73 5b 31 5d 5b 22 63 6f 6c 6f 72 22 5d 20 ed".....>>>.G.nodes[1]["color"].
3c00 3d 20 22 72 65 64 22 0a 20 20 20 20 3e 3e 3e 20 47 2e 6e 6f 64 65 73 5b 32 5d 5b 22 63 6f 6c 6f =."red".....>>>.G.nodes[2]["colo
3c20 72 22 5d 20 3d 20 22 62 6c 75 65 22 0a 20 20 20 20 3e 3e 3e 20 72 63 20 3d 20 5b 22 72 65 64 22 r"].=."blue".....>>>.rc.=.["red"
3c40 2c 20 22 62 6c 75 65 22 5d 0a 20 20 20 20 3e 3e 3e 20 4d 20 3d 20 6e 78 2e 61 74 74 72 5f 73 70 ,."blue"].....>>>.M.=.nx.attr_sp
3c60 61 72 73 65 5f 6d 61 74 72 69 78 28 47 2c 20 6e 6f 64 65 5f 61 74 74 72 3d 22 63 6f 6c 6f 72 22 arse_matrix(G,.node_attr="color"
3c80 2c 20 6e 6f 72 6d 61 6c 69 7a 65 64 3d 54 72 75 65 2c 20 72 63 5f 6f 72 64 65 72 3d 72 63 29 0a ,.normalized=True,.rc_order=rc).
3ca0 20 20 20 20 3e 3e 3e 20 4d 2e 74 6f 61 72 72 61 79 28 29 0a 20 20 20 20 61 72 72 61 79 28 5b 5b ....>>>.M.toarray().....array([[
3cc0 30 2e 33 33 33 33 33 33 33 33 2c 20 30 2e 36 36 36 36 36 36 36 37 5d 2c 0a 20 20 20 20 20 20 20 0.33333333,.0.66666667],........
3ce0 20 20 20 20 5b 31 2e 20 20 20 20 20 20 20 20 2c 20 30 2e 20 20 20 20 20 20 20 20 5d 5d 29 0a 0a ....[1.........,.0.........]])..
3d00 20 20 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 68 65 20 61 62 6f 76 65 20 74 65 6c 6c 73 ....For.example,.the.above.tells
3d20 20 75 73 20 74 68 61 74 20 66 6f 72 20 61 6c 6c 20 65 64 67 65 73 20 28 75 2c 76 29 3a 0a 0a 20 .us.that.for.all.edges.(u,v):...
3d40 20 20 20 20 20 20 20 50 72 28 20 76 20 69 73 20 72 65 64 20 20 7c 20 75 20 69 73 20 72 65 64 29 .......Pr(.v.is.red..|.u.is.red)
3d60 20 20 3d 20 31 2f 33 0a 20 20 20 20 20 20 20 20 50 72 28 20 76 20 69 73 20 62 6c 75 65 20 7c 20 ..=.1/3.........Pr(.v.is.blue.|.
3d80 75 20 69 73 20 72 65 64 29 20 20 3d 20 32 2f 33 0a 0a 20 20 20 20 20 20 20 20 50 72 28 20 76 20 u.is.red)..=.2/3..........Pr(.v.
3da0 69 73 20 72 65 64 20 20 7c 20 75 20 69 73 20 62 6c 75 65 29 20 3d 20 31 0a 20 20 20 20 20 20 20 is.red..|.u.is.blue).=.1........
3dc0 20 50 72 28 20 76 20 69 73 20 62 6c 75 65 20 7c 20 75 20 69 73 20 62 6c 75 65 29 20 3d 20 30 0a .Pr(.v.is.blue.|.u.is.blue).=.0.
3de0 0a 20 20 20 20 46 69 6e 61 6c 6c 79 2c 20 77 65 20 63 61 6e 20 6f 62 74 61 69 6e 20 74 68 65 20 .....Finally,.we.can.obtain.the.
3e00 74 6f 74 61 6c 20 77 65 69 67 68 74 73 20 6c 69 73 74 65 64 20 62 79 20 74 68 65 20 6e 6f 64 65 total.weights.listed.by.the.node
3e20 20 63 6f 6c 6f 72 73 2e 0a 0a 20 20 20 20 3e 3e 3e 20 4d 20 3d 20 6e 78 2e 61 74 74 72 5f 73 70 .colors.......>>>.M.=.nx.attr_sp
3e40 61 72 73 65 5f 6d 61 74 72 69 78 28 47 2c 20 65 64 67 65 5f 61 74 74 72 3d 22 77 65 69 67 68 74 arse_matrix(G,.edge_attr="weight
3e60 22 2c 20 6e 6f 64 65 5f 61 74 74 72 3d 22 63 6f 6c 6f 72 22 2c 20 72 63 5f 6f 72 64 65 72 3d 72 ",.node_attr="color",.rc_order=r
3e80 63 29 0a 20 20 20 20 3e 3e 3e 20 4d 2e 74 6f 61 72 72 61 79 28 29 0a 20 20 20 20 61 72 72 61 79 c).....>>>.M.toarray().....array
3ea0 28 5b 5b 33 2e 2c 20 32 2e 5d 2c 0a 20 20 20 20 20 20 20 20 20 20 20 5b 32 2e 2c 20 30 2e 5d 5d ([[3.,.2.],............[2.,.0.]]
3ec0 29 0a 0a 20 20 20 20 54 68 75 73 2c 20 74 68 65 20 74 6f 74 61 6c 20 77 65 69 67 68 74 20 6f 76 )......Thus,.the.total.weight.ov
3ee0 65 72 20 61 6c 6c 20 65 64 67 65 73 20 28 75 2c 76 29 20 77 69 74 68 20 75 20 61 6e 64 20 76 20 er.all.edges.(u,v).with.u.and.v.
3f00 68 61 76 69 6e 67 20 63 6f 6c 6f 72 73 3a 0a 0a 20 20 20 20 20 20 20 20 28 72 65 64 2c 20 72 65 having.colors:..........(red,.re
3f20 64 29 20 20 20 69 73 20 33 20 20 20 23 20 74 68 65 20 73 6f 6c 65 20 63 6f 6e 74 72 69 62 75 74 d)...is.3...#.the.sole.contribut
3f40 69 6f 6e 20 69 73 20 66 72 6f 6d 20 65 64 67 65 20 28 30 2c 31 29 0a 20 20 20 20 20 20 20 20 28 ion.is.from.edge.(0,1).........(
3f60 72 65 64 2c 20 62 6c 75 65 29 20 20 69 73 20 32 20 20 20 23 20 63 6f 6e 74 72 69 62 75 74 69 6f red,.blue)..is.2...#.contributio
3f80 6e 73 20 66 72 6f 6d 20 65 64 67 65 73 20 28 30 2c 32 29 20 61 6e 64 20 28 31 2c 32 29 0a 20 20 ns.from.edges.(0,2).and.(1,2)...
3fa0 20 20 20 20 20 20 28 62 6c 75 65 2c 20 72 65 64 29 20 20 69 73 20 32 20 20 20 23 20 73 61 6d 65 ......(blue,.red)..is.2...#.same
3fc0 20 61 73 20 28 72 65 64 2c 20 62 6c 75 65 29 20 73 69 6e 63 65 20 67 72 61 70 68 20 69 73 20 75 .as.(red,.blue).since.graph.is.u
3fe0 6e 64 69 72 65 63 74 65 64 0a 20 20 20 20 20 20 20 20 28 62 6c 75 65 2c 20 62 6c 75 65 29 20 69 ndirected.........(blue,.blue).i
4000 73 20 30 20 20 20 23 20 74 68 65 72 65 20 61 72 65 20 6e 6f 20 65 64 67 65 73 20 77 69 74 68 20 s.0...#.there.are.no.edges.with.
4020 62 6c 75 65 20 65 6e 64 70 6f 69 6e 74 73 0a 0a 20 20 20 20 72 02 00 00 00 4e 29 01 72 31 00 00 blue.endpoints......r....N).r1..
4040 00 72 19 00 00 00 72 33 00 00 00 29 11 72 35 00 00 00 da 05 73 63 69 70 79 72 2d 00 00 00 72 12 .r....r3...).r5.....scipyr-...r.
4060 00 00 00 72 36 00 00 00 72 15 00 00 00 72 37 00 00 00 72 38 00 00 00 72 39 00 00 00 72 3a 00 00 ...r6...r....r7...r8...r9...r:..
4080 00 da 06 73 70 61 72 73 65 da 09 6c 69 6c 5f 61 72 72 61 79 72 3c 00 00 00 72 3d 00 00 00 72 3e ...sparse..lil_arrayr<...r=...r>
40a0 00 00 00 72 25 00 00 00 da 07 6e 65 77 61 78 69 73 29 16 72 0f 00 00 00 72 22 00 00 00 72 10 00 ...r%.....newaxis).r....r"...r..
40c0 00 00 72 40 00 00 00 72 41 00 00 00 72 31 00 00 00 72 42 00 00 00 da 02 73 70 72 43 00 00 00 72 ..r@...rA...r1...rB.....sprC...r
40e0 44 00 00 00 72 45 00 00 00 72 46 00 00 00 72 47 00 00 00 72 48 00 00 00 72 49 00 00 00 72 4a 00 D...rE...rF...rG...rH...rI...rJ.
4100 00 00 72 4b 00 00 00 72 09 00 00 00 72 4c 00 00 00 72 16 00 00 00 72 4d 00 00 00 72 4e 00 00 00 ..rK...r....rL...r....rM...rN...
4120 73 16 00 00 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 0a 00 00 00 s..........................r....
4140 72 04 00 00 00 72 04 00 00 00 37 01 00 00 73 67 01 00 00 80 00 f3 70 03 00 05 17 db 04 16 e4 11 r....r....7...sg......p.........
4160 1c 98 51 a0 09 d3 11 2a 80 4a dc 11 1c 98 51 a0 09 d3 11 2a 80 4a e0 07 0f d0 07 17 dc 13 17 b0 ..Q....*.J....Q....*.J..........
4180 01 d6 18 32 a8 31 99 1a a0 41 9d 1d d2 18 32 d3 13 33 89 08 e0 13 1b 88 08 e4 08 0b 88 48 8b 0d ...2.1...A....2..3...........H..
41a0 80 41 d8 15 16 97 5d 91 5d 93 5f d0 11 24 80 4a dc 0c 10 94 13 90 58 9c 75 a0 51 9b 78 d3 11 28 .A....].]._..$.J......X.u.Q.x..(
41c0 d3 0c 29 80 45 d8 08 0a 8f 09 89 09 d7 08 1b d1 08 1b 98 51 a0 01 98 46 a8 25 d0 08 1b d3 08 30 ..).E..............Q...F.%.....0
41e0 80 41 e4 0b 0e 8b 35 80 44 d8 16 17 97 6b 91 6b 93 6d f2 00 0a 05 18 89 0a 88 01 88 37 d8 11 18 .A....5.D....k.k.m..........7...
4200 f2 00 06 09 26 88 41 e0 13 18 99 1a a0 41 9b 1d d1 13 27 a8 15 a9 7a b8 21 ab 7d d1 29 3d 88 71 ....&.A......A....'...z.!.}.)=.q
4220 88 41 d8 0f 10 98 04 8a 7d d8 10 11 90 21 90 51 90 24 93 07 99 3a a0 61 a8 11 d3 1b 2b d1 10 2b .A......}....!.Q.$...:.a....+..+
4240 93 07 da 13 1d d8 1e 1f a0 01 a0 31 a0 04 99 67 90 41 90 61 98 11 90 64 92 47 f0 0d 06 09 26 f2 ...........1...g.A.a...d.G....&.
4260 10 00 0c 16 d8 0c 10 8f 48 89 48 90 51 8d 4b f0 15 0a 05 18 f1 18 00 08 12 d8 08 09 88 51 90 11 ........H.H.Q.K..............Q..
4280 97 15 91 15 98 41 90 15 93 1d 9a 71 a0 22 a7 2a a1 2a 98 7d d1 11 2d d1 0d 2d d1 08 2d 88 01 e0 .....A.....q.".*.*.}..-..-..-...
42a0 07 0f d0 07 17 d8 0f 10 90 28 88 7b d0 08 1a e0 0f 10 88 08 f9 f2 39 00 19 33 73 05 00 00 00 ac .........(.{..........9..3s.....
42c0 0f 45 0e 08 29 06 4e 4e 46 4e 4e 4e 29 05 4e 4e 46 4e 4e 29 09 da 07 5f 5f 64 6f 63 5f 5f da 08 .E..).NNFNNN).NNFNN)...__doc__..
42e0 6e 65 74 77 6f 72 6b 78 da 02 6e 78 da 07 5f 5f 61 6c 6c 5f 5f 72 12 00 00 00 72 2d 00 00 00 da networkx..nx..__all__r....r-....
4300 0d 5f 64 69 73 70 61 74 63 68 61 62 6c 65 72 03 00 00 00 72 04 00 00 00 72 08 00 00 00 72 0c 00 ._dispatchabler....r....r....r..
4320 00 00 72 0a 00 00 00 fa 08 3c 6d 6f 64 75 6c 65 3e 72 5a 00 00 00 01 00 00 00 73 95 00 00 00 f0 ..r......<module>rZ.......s.....
4340 03 01 01 01 f1 02 02 01 04 f3 08 00 01 16 e0 0b 18 d0 1a 2e d0 0a 2f 80 07 f2 06 2a 01 11 f2 5a ....................../....*...Z
4360 01 58 01 01 11 f0 76 02 00 02 12 80 12 d7 01 11 d1 01 11 98 6b a8 34 d0 1d 30 b8 5b d4 01 49 f0 .X....v.............k.4..0.[..I.
4380 06 00 0f 13 d8 0e 12 d8 0f 14 d8 0d 11 d8 0a 0e d8 0a 0e f2 0f 61 02 01 11 f3 03 00 02 4a 01 f0 .....................a.......J..
43a0 02 61 02 01 11 f0 48 05 00 02 12 80 12 d7 01 11 d1 01 11 98 6b a8 34 d0 1d 30 b8 5b d4 01 49 e0 .a....H.............k.4..0.[..I.
43c0 4e 52 f2 03 5a 02 01 11 f3 03 00 02 4a 01 f1 02 5a 02 01 11 72 0c 00 00 00 NR..Z.......J...Z...r....