All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jgrapht.alg.shortestpath.MartinShortestPath Maven / Gradle / Ivy

The newest version!
/*
 * (C) Copyright 2017-2023, by Dimitrios Michail and Contributors.
 *
 * JGraphT : a free Java graph-theory library
 *
 * See the CONTRIBUTORS.md file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0, or the
 * GNU Lesser General Public License v2.1 or later
 * which is available at
 * http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR LGPL-2.1-or-later
 */
package org.jgrapht.alg.shortestpath;

import org.jgrapht.*;
import org.jgrapht.graph.*;
import org.jheaps.*;
import org.jheaps.array.*;

import java.util.*;
import java.util.function.*;
import java.util.stream.*;

/**
 * Martin's algorithm for the multi-objective shortest paths problem.
 * 
 * 

* Martin's label setting algorithm is a multiple objective extension of Dijkstra's algorithm, where * the minimum operator is replaced by a dominance test. It computes a maximal complete set of * efficient paths when all the cost values are non-negative. * *

* Note that the multi-objective shortest path problem is a well-known NP-hard problem. * * @author Dimitrios Michail * * @param the vertex type * @param the edge type */ public class MartinShortestPath extends BaseMultiObjectiveShortestPathAlgorithm { // the edge weight function private final Function edgeWeightFunction; // the number of objectives private final int objectives; // final labels for each node private final Map> nodeLabels; // temporary labels ordered lexicographically private final Heap





© 2015 - 2024 Weber Informatics LLC | Privacy Policy