001/* An interface for all the analyzers that compute the all pair shortest path 002 of a directed graph. 003 004 Copyright (c) 2003-2005 The University of Maryland. 005 All rights reserved. 006 Permission is hereby granted, without written agreement and without 007 license or royalty fees, to use, copy, modify, and distribute this 008 software and its documentation for any purpose, provided that the above 009 copyright notice and the following two paragraphs appear in all copies 010 of this software. 011 012 IN NO EVENT SHALL THE UNIVERSITY OF MARYLAND BE LIABLE TO ANY PARTY 013 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 014 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 015 THE UNIVERSITY OF MARYLAND HAS BEEN ADVISED OF THE POSSIBILITY OF 016 SUCH DAMAGE. 017 018 THE UNIVERSITY OF MARYLAND SPECIFICALLY DISCLAIMS ANY WARRANTIES, 019 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 020 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 021 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 022 MARYLAND HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 023 ENHANCEMENTS, OR MODIFICATIONS. 024 025 */ 026package ptolemy.graph.analysis.analyzer; 027 028import java.util.List; 029 030import ptolemy.graph.Node; 031 032////////////////////////////////////////////////////////////////////////// 033//// AllPairShortestPathAnalyzer 034 035/** 036 An interface for all the analyzers that compute the all pair shortest path of 037 a directed graph. 038 <p> 039 @see ptolemy.graph.analysis.AllPairShortestPathAnalysis 040 @since Ptolemy II 4.0 041 @Pt.ProposedRating Red (shahrooz) 042 @Pt.AcceptedRating Red (ssb) 043 @author Shahrooz Shahparnia 044 @version $Id$ 045 */ 046public interface AllPairShortestPathAnalyzer extends GraphAnalyzer { 047 /** Return the nodes on the shortest path from the node 048 * "startNode" to the node "endNode" in the form of an ordered list. 049 * 050 * @param startNode The starting node of the path. 051 * @param endNode The ending node of the path. 052 * @return Return the nodes on the shortest path from the 053 * node "startNode" to the node "endNode" in the form of an ordered list. 054 */ 055 public List shortestPath(Node startNode, Node endNode); 056 057 /** Return the length of the shortest path from the node 058 * startNode to the node endNode. 059 * 060 * @param startNode The starting node of the path. 061 * @param endNode The end node of the path. 062 * @return Return the length of the shortest path from the node 063 * startNode to the node endNode. 064 */ 065 public double shortestPathLength(Node startNode, Node endNode); 066 067 /** A matrix representing the result of the all pair shortest path 068 * algorithm. 069 * The first dimension is indexed by the source node label while the 070 * second one is indexed by the sink node label. 071 * 072 * @see ptolemy.graph.Graph#nodeLabel 073 * @return Return a matrix representing the result of the all pair shortest 074 * path algorithm. 075 */ 076 public double[][] shortestPathMatrix(); 077}