Class FastDirectedUnweightedMultiGraph<U>

java.lang.Object
es.uam.eps.ir.relison.graph.multigraph.fast.AbstractFastMultiGraph<U>
es.uam.eps.ir.relison.graph.multigraph.fast.FastDirectedUnweightedMultiGraph<U>
Type Parameters:
U - Type of the nodes
All Implemented Interfaces:
DirectedGraph<U>, FastGraph<U>, Graph<U>, DirectedMultiGraph<U>, DirectedUnweightedMultiGraph<U>, FastMultiGraph<U>, MultiGraph<U>, UnweightedMultiGraph<U>, UnweightedGraph<U>, ReducedIndex<U>, java.io.Serializable

public class FastDirectedUnweightedMultiGraph<U>
extends AbstractFastMultiGraph<U>
implements DirectedUnweightedMultiGraph<U>
Fast implementation for a directed unweighted multi-graph. This implementation does not allow removing edges.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • getAdjacencyMatrix

      public double[][] getAdjacencyMatrix​(EdgeOrientation direction)
      Description copied from interface: Graph
      Gets the adjacency matrix.
      Specified by:
      getAdjacencyMatrix in interface Graph<U>
      Parameters:
      direction - The direction of the edges.
      Returns:
      the adjacency matrix.
    • getMutualNodes

      public java.util.stream.Stream<U> getMutualNodes​(U node)
      Description copied from interface: Graph
      Given a node, finds all the nodes u such that the edges (node to u) and (u to node) are in the graph.
      Specified by:
      getMutualNodes in interface Graph<U>
      Parameters:
      node - The node.
      Returns:
      A stream containing all the nodes which share reciprocal links.
    • getMutualEdgesCount

      public int getMutualEdgesCount​(U node)
      Description copied from interface: Graph
      Calculates the total number of adjacent edges of a node such that there is an incident reciprocal link towards the node.
      Specified by:
      getMutualEdgesCount in interface Graph<U>
      Parameters:
      node - The node.
      Returns:
      the number of reciprocal links starting from the node.
    • getAdjacentMutualNodesTypes

      public java.util.stream.Stream<Weight<U,​java.lang.Integer>> getAdjacentMutualNodesTypes​(U node)
      Description copied from interface: Graph
      Given a node, finds the types of the edges towards the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.
      Specified by:
      getAdjacentMutualNodesTypes in interface Graph<U>
      Parameters:
      node - The node.
      Returns:
      A stream containing all the nodes in the neighbourhood and types.
    • getIncidentMutualNodesTypes

      public java.util.stream.Stream<Weight<U,​java.lang.Integer>> getIncidentMutualNodesTypes​(U node)
      Description copied from interface: Graph
      Given a node, finds the types of the edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.
      Specified by:
      getIncidentMutualNodesTypes in interface Graph<U>
      Parameters:
      node - The node.
      Returns:
      A stream containing all the nodes in the neighbourhood and types.
    • getMutualNodesTypes

      public java.util.stream.Stream<Weight<U,​java.lang.Integer>> getMutualNodesTypes​(U node)
      Description copied from interface: Graph
      Given a node, find the types of edges from the nodes u such that the edge (node to u) and the edge (u to node) are in the graph.
      Specified by:
      getMutualNodesTypes in interface Graph<U>
      Parameters:
      node - the node.
      Returns:
      a stream containing all the nodes in the neighbourhood and types.