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

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

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

This class arranges nodes and links in descending order of betweenness centrality (BC), optionally shuffling the order of nodes having the same degree. BrandesBC is used in order to calculate the BC. The non-normalized version of the algorithm is considered here.

Note: in order to consider the graph as weighted the environment must contain:

 BrandesBC.weighted=true
 

Author:
mmanzano

Constructor Summary
SequencerBC()
          Default constructor.
SequencerBC(TED<V,E> ted, Environ env)
          Creates a new instance and calls setup to complete the initialization.
 
Method Summary
 java.util.List<E> arrangeDirectedLinks(java.util.Random rnd)
          Returns all the links of the graph, which is considered directed, sorted by their betweenness centrality in descending order.
 java.util.List<E> arrangeLinks(java.util.Random rnd, boolean directed)
           
 java.util.List<V> arrangeNodes(java.util.Random rnd)
          Returns all nodes of the graph sorted by their betweenness centrality in descending order.
 java.util.List<E> arrangeUndirectedLinks(java.util.Random rnd)
          Returns all the links of the graph, which is considered undirected, sorted by their betweenness centrality in descending order.
static
<V,E> java.util.SortedMap<java.lang.Long,java.util.List<E>>
groupLinksByBC(java.util.Map<E,java.lang.Long> bc_links)
          Groups by the links BC (the value is previously trunked).
static
<V,E> java.util.SortedMap<java.lang.Long,java.util.List<V>>
groupNodesByBC(java.util.Map<V,java.lang.Long> bc_nodes)
          Groups by the nodes BC (the value is previously trunked).
 
Methods inherited from class bcds.phison.multfailures.ElemsSequencerBase
getEnviron, getEnvParams, getName, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequencerBC

public SequencerBC()
Default constructor.


SequencerBC

public SequencerBC(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 betweenness centrality in descending order. If rnd is not null, nodes of the same BC are "shuffled" randomly, so that successive calls will return different results, but always observing that BC(v_j) >= BC(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>

groupNodesByBC

public static <V,E> java.util.SortedMap<java.lang.Long,java.util.List<V>> groupNodesByBC(java.util.Map<V,java.lang.Long> bc_nodes)
Groups by the nodes BC (the value is previously trunked).


arrangeUndirectedLinks

public java.util.List<E> arrangeUndirectedLinks(java.util.Random rnd)
Returns all the links of the graph, which is considered undirected, sorted by their betweenness centrality in descending order. If rnd is not null, links of the same BC are "shuffled" randomly, so that successive calls will return different results, but always observing that BC(l_j) >= BC(l_k) for all j,k in [0..N), j < k. If rnd is null, links are sorted within their respective group by their "natural" order.

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

arrangeDirectedLinks

public java.util.List<E> arrangeDirectedLinks(java.util.Random rnd)
Returns all the links of the graph, which is considered directed, sorted by their betweenness centrality in descending order. If rnd is not null, links of the same BC are "shuffled" randomly, so that successive calls will return different results, but always observing that BC(l_j) >= BC(l_k) for all j,k in [0..N), j < k. If rnd is null, links are sorted within their respective group by their "natural" order.

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

arrangeLinks

public java.util.List<E> arrangeLinks(java.util.Random rnd,
                                      boolean directed)

groupLinksByBC

public static <V,E> java.util.SortedMap<java.lang.Long,java.util.List<E>> groupLinksByBC(java.util.Map<E,java.lang.Long> bc_links)
Groups by the links BC (the value is previously trunked).