- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Known Implementing Classes:
CentersLocationAlgorithmBase,GonHeuristic
public interface CentersLocationAlgorithm<V,E>
An algorithm for solving the vertex $k$-center
problem.
Center location problems are a class of optimization problems in graph theory and operations research that aims selecting optimal locations for facilities (centers) to minimize the distance or cost for serving a set of demand points or clients (vertices) in a graph.
- Author:
- Jose Alejandro Cornejo-Acosta
-
Method Summary
Modifier and TypeMethodDescriptionComputes the assignment of vertices to their respective centers.getCenters(Graph<V, E> graph, int k) Computes a set of centers.doubleObtains the covering radius of the solution.
-
Method Details
-
getCenters
Computes a set of centers.- Parameters:
graph- the input graph.k- the number of centers to locate.- Returns:
- a set of centes.
-
getAssignment
Computes the assignment of vertices to their respective centers. This method computes and returns the mapping function $f:V\setminus C \rightarrow C$. Each key represents a vertex in the graph, and the corresponding value represents the center to which the vertex is assigned. The mapping reflects the result of any center location algorithm after thegetCenters(org.jgrapht.Graph<V, E>, int)method has been called.- Returns:
- a mapping from vertices to their assigned centers
-
getCoveringRadius
double getCoveringRadius()Obtains the covering radius of the solution.- Returns:
- the covering radius of the solution.
-