bcds.phison.multfailures
Class SequencerCC<V,E>

java.lang.Object
  extended by bcds.phison.multfailures.ElemsSequencerBase<V,E>
      extended by bcds.phison.multfailures.SequencerCC<V,E>
All Implemented Interfaces:
ElemsSequencer<V,E>, WithEnvParams

public class SequencerCC<V,E>
extends ElemsSequencerBase<V,E>

This class arranges nodes in descending order of clustering coefficient (CC). It does not implement ElemsSequencer.arrangeDirectedLinks(java.util.Random) or ElemsSequencer.arrangeUndirectedLinks(java.util.Random).

Author:
mmanzano

Constructor Summary
SequencerCC()
          Default constructor.
SequencerCC(TED<V,E> ted, Environ env)
          Creates a new instance and calls setup to complete the initialization.
 
Method Summary
 java.util.List<V> arrangeNodes(java.util.Random rnd)
          Returns all nodes of the graph sorted by their clustering coefficient in descending order.
static
<V,E> java.util.SortedMap<java.lang.Long,java.util.List<V>>
groupNodesByCC(java.util.Map<V,java.lang.Long> cc_nodes)
          Groups by the nodes clustering coefficient (the value is previously trunked).
 
Methods inherited from class bcds.phison.multfailures.ElemsSequencerBase
arrangeDirectedLinks, arrangeUndirectedLinks, getEnviron, getEnvParams, getName, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequencerCC

public SequencerCC()
Default constructor.


SequencerCC

public SequencerCC(TED<V,E> ted,
                   Environ env)
Creates a new instance and calls setup to complete the initialization.

Method Detail

arrangeNodes

public java.util.List<V> arrangeNodes(java.util.Random rnd)
Returns all nodes of the graph sorted by their clustering coefficient in descending order. If rnd is not null, nodes of the same clustering coefficient are "shuffled" randomly, so that successive calls will return different results, but always observing that CC(v_j) >= CC(v_k) for all j,k in [0..N), j < k. If rnd is null, nodes are sorted within their respective group by their "natural" order.

Specified by:
arrangeNodes in interface ElemsSequencer<V,E>
Overrides:
arrangeNodes in class ElemsSequencerBase<V,E>

groupNodesByCC

public static <V,E> java.util.SortedMap<java.lang.Long,java.util.List<V>> groupNodesByCC(java.util.Map<V,java.lang.Long> cc_nodes)
Groups by the nodes clustering coefficient (the value is previously trunked).