@@ -409,21 +409,22 @@ def slices_to_layers(G_coupling,
409409
410410 Now in order to optimise partitions across these different slices, we
411411 represent them slightly differently, namely as layers. The idea of layers is
412- that all graphs always are defined on the same set of nodes, and that only
413- the links differ for different layers. We thus create new nodes as
414- combinations of original nodes and slices. For example, if node 1 existed in
415- both slice 1 and in slice 2, we will thus create two nodes to build the
416- layers: a node 1-1 and a node 1-2. Additionally, if the slices are connected
417- in the slice graph, the two nodes would also be connected, so there would be
418- a linke between node 1-1 and 1-2. Different slices will then correspond to
419- different layers: each layer only contains the link for that particular
420- slice. In addition, for methods such as :class:`CPMVertexPartition`,
421- so-called ``node_sizes`` are required, and for them to properly function,
422- they should be set to 0 (which is handled appropriately in this function, and
423- stored in the vertex attribute ``node_size``). We thus obtain equally many
424- layers as we have slices, and we need one more layer for representing the
425- interslice couplings. For the example provided above, we thus obtain the
426- following:
412+ that all graphs always are defined on the same set of nodes, and that only the
413+ links differ for different layers. We thus create new nodes as combinations of
414+ original nodes and slices. For example, if node 1 existed in both slice 1 and
415+ in slice 2, we will thus create two nodes to build the layers: a node 1-1 and
416+ a node 1-2. Additionally, if the slices are connected in the slice graph, the
417+ two nodes would also be connected, so there would be a linke between node 1-1
418+ and 1-2. Different slices will then correspond to different layers: each layer
419+ only contains the link for that particular slice. In addition, for methods
420+ such as :class:`CPMVertexPartition`, so-called ``node_sizes`` are required,
421+ and for them to properly function, they should be set to 1 only for nodes of a
422+ layer that represent nodes of the corresponding slice and 0 for the other
423+ nodes (which is handled appropriately in this function, and stored in the
424+ vertex attribute ``node_size``). Additionally, ``node_sizes`` should be set to
425+ 0 for the interslice coupling layer. We thus obtain equally many layers as we
426+ have slices, and we need one more layer for representing the interslice
427+ couplings. For the example provided above, we thus obtain the following:
427428
428429 .. image:: figures/layers_separate.png
429430
0 commit comments