001/* Copyright (C) 2013 TU Dortmund
002 * This file is part of AutomataLib, http://www.automatalib.net/.
003 * 
004 * AutomataLib is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License version 3.0 as published by the Free Software Foundation.
007 * 
008 * AutomataLib is distributed in the hope that it will be useful,
009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011 * Lesser General Public License for more details.
012 * 
013 * You should have received a copy of the GNU Lesser General Public
014 * License along with AutomataLib; if not, see
015 * http://www.gnu.de/documents/lgpl.en.html.
016 */
017package net.automatalib.algorithms.graph.apsp;
018
019import java.util.List;
020
021/**
022 * Result interface for the all pairs shortest paths problem.
023 * 
024 * @author Malte Isberner <malte.isberner@gmail.com>
025 *
026 * @param <N> node class
027 * @param <E> edge class
028 */
029public interface APSPResult<N,E> {
030
031        
032        /**
033         * Retrieves the length of the shortest path between the given nodes.
034         * @param src the source node
035         * @param tgt the target node
036         * @return the length of the shortest path from <tt>src</tt> to <tt>tgt</tt>,
037         * or {@link GraphAlgorithms#INVALID_DISTANCE} if there exists no such path.
038         */
039        public float getShortestPathDistance(N src, N tgt);
040        
041        /**
042         * Retrieves the shortest path between the given nodes, or <tt>null</tt> if there
043         * exists no such path.
044         * @param src the source node
045         * @param tgt the target node
046         * @return the shortest path from <tt>src</tt> to <tt>tgt</tt>, or <tt>null</tt>
047         * if there exists no such path.
048         */
049        public List<E> getShortestPath(N src, N tgt);
050}