Class HyperEdge
java.lang.Object
org.unifi.mecvirtualresourceallocation.graph.HyperEdge
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a vertex to the hyperedge.getId()
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.toString()
Returns a string representation of the hyperedge, including its vertices and weight.
-
Constructor Details
-
HyperEdge
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
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 hyperedgevertices
- the set of vertices that this hyperedge connects
-
-
Method Details
-
getId
Gets the unique identifier of the hyperedge.- Returns:
- the unique identifier of the hyperedge
-
getVertices
Gets the set of vertices that this hyperedge connects.- Returns:
- the set of vertices
-
addVertex
Adds a vertex to the hyperedge.- Parameters:
vertex
- the vertex to be added to the hyperedge
-
getWeight
Gets the weight of the hyperedge, which is the sum of the weights of its vertices.- Returns:
- the weight of the hyperedge
-
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
Returns a string representation of the hyperedge, including its vertices and weight.
-