Class ComplexPathAlgorithm

Inheritance Relationships

Base Type

Class Documentation

class ComplexPathAlgorithm : public NetworKit::Algorithm

computes in Mode::singleNode : complex path graphs (with inner connection degree above threshold) from a start node in Mode::singleNode OR in Mode::allNodes : complex path lengths (maximal distance in complex path graphs for starting nodes u) for all nodes u

Public Types

enum Mode

operation modes

Values:

enumerator singleNode
enumerator allNodes

Public Functions

ComplexPathAlgorithm(const Graph &G, count threshold = 3, Mode mode = Mode::allNodes, node start = none)

Constructs the ComplexPathAlgorithm class for the given Graph G. depending on the mode the algorithm the algorithm in mode Mode::singleNode starting from start constructs a subgraph of G in which all inner nodes have more than threshold neighbors call getComplexGraph after run to get it in mode Mode::allNodes constructs these subgraphs for all nodes and calculates their longest paths from their start nodes these length can be absolute or normalized to [0..1] by calling normalize before or after run call getPLci after run to get these lengths

Parameters:
  • G – The graph.

  • threshold – number of neighbors needed

  • mode – as explained above

  • start – start node for Mode::singleNode

void normalize()

normalize path lengths

virtual void run() override

The generic run method which calls runImpl() and takes care of setting hasRun to the appropriate value.

std::vector<double> getPLci()

[normalized] results after running in Mode::allNodes

Graph getComplexGraph()

resulting graph after running in Mode::singleNode

std::vector<node> getAdopters()

nodes in the resulting graph after running in Mode::singleNode which are connected to start by at least threshold paths