java.lang.Object
org.unifi.mecvirtualresourceallocation.graph.HyperEdge

public final class HyperEdge extends Object
This class represents a hyperedge in a hypergraph. A hyperedge is an edge that can connect more than two vertices, which in this context corresponds to linking multiple virtual machine (VM) instances. Each hyperedge can be used to model the relationships between multiple VMs and physical machines (PMs) in a Mobile Edge Computing (MEC) environment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a hyperedge with the specified id.
    HyperEdge(String id, Set<Vertex> vertices)
    Constructs a hyperedge with the specified id, vertices, and calculates the initial weight based on the sum of the weights of the vertices.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addVertex(Vertex vertex)
    Adds a vertex to the hyperedge.
    Gets the unique identifier of the hyperedge.
    Gets the negative weight of the hyperedge, which is the sum of the negative weights of its vertices.
    Gets the set of vertices that this hyperedge connects.
    Gets the weight of the hyperedge, which is the sum of the weights of its vertices.
    Returns a string representation of the hyperedge, including its vertices and weight.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HyperEdge

      public HyperEdge(String id)
      Constructs a hyperedge with the specified id. Initializes an empty set of vertices and sets the initial weight to zero.
      Parameters:
      id - the unique identifier of the hyperedge
    • HyperEdge

      public HyperEdge(String id, Set<Vertex> vertices)
      Constructs a hyperedge with the specified id, vertices, and calculates the initial weight based on the sum of the weights of the vertices.
      Parameters:
      id - the unique identifier of the hyperedge
      vertices - the set of vertices that this hyperedge connects
  • Method Details

    • getId

      public String getId()
      Gets the unique identifier of the hyperedge.
      Returns:
      the unique identifier of the hyperedge
    • getVertices

      public Set<Vertex> getVertices()
      Gets the set of vertices that this hyperedge connects.
      Returns:
      the set of vertices
    • addVertex

      public void addVertex(Vertex vertex)
      Adds a vertex to the hyperedge.
      Parameters:
      vertex - the vertex to be added to the hyperedge
    • getWeight

      public BigDecimal getWeight()
      Gets the weight of the hyperedge, which is the sum of the weights of its vertices.
      Returns:
      the weight of the hyperedge
    • getNegativeWeight

      public BigDecimal getNegativeWeight()
      Gets the negative weight of the hyperedge, which is the sum of the negative weights of its vertices.
      Returns:
      the negative weight of the hyperedge
    • toString

      public String toString()
      Returns a string representation of the hyperedge, including its vertices and weight.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the hyperedge