src/ADT/Graph/Weighted.php
public function getPath( $source, $target, $stack = false )
	{
		if( !( $stack && $stack->_getObjectName() == "ADT_List_Stack") )
			$stack = new ADT_List_Stack();
		$hadNodes = array();
		$ways = $this->getWays( $source, $target, $stack, $hadNodes );
		if( sizeof( $ways ) )
		{
			foreach( $ways as $way )
			{
				if( !isset( $fastestWay ) )
					$fastestWay = $way;
				else if( $fastestWay->getSize() > $way->getSize() )
					$fastestWay = $way;
			}
			if( isset( $fastestWay ) )
				if( $fastestWay)
					return $fastestWay;
		}
		return false;
	}
public function getPath( $source, $target, $stack = false )
	{
		if( !( $stack && $stack->_getObjectName() == "ADT_List_Stack") )
			$stack = new ADT_List_Stack();
		$hadNodes = array();
		$ways = $this->getWays( $source, $target, $stack, $hadNodes );
		if( sizeof( $ways ) )
		{
			foreach( $ways as $way )
			{
				if( !isset( $fastestWay ) )
					$fastestWay = $way;
				else if( $fastestWay->getSize() > $way->getSize() )
					$fastestWay = $way;
			}
			if( isset( $fastestWay ) )
				if( $fastestWay)
					return $fastestWay;
		}
		return false;
	}
public function getPath ( $ source , $ target , $ stack = false ) { if ( ! ( $ stack && $ stack -> _getObjectName ( ) == "ADT_List_Stack" ) ) $ stack = new ADT_List_Stack ( ) ; $ hadNodes = array ( ) ; $ ways = $ this -> getWays ( $ source , $ target , $ stack , $ hadNodes ) ; if ( sizeof ( $ ways ) ) { foreach ( $ ways as $ way ) { if ( ! isset ( $ fastestWay ) ) $ fastestWay = $ way ; else if ( $ fastestWay -> getSize ( ) > $ way -> getSize ( ) ) $ fastestWay = $ way ; } if ( isset ( $ fastestWay ) ) if ( $ fastestWay ) return $ fastestWay ; } return false ; }
Returns path between two Nodes as Stack, if way exists.
@access		public
@param		ADT_Graph_Node	$source		Source Node
@param		ADT_Graph_Node	$target		Target Node
@param		ADT_List_Stack	$stack		Stack to fill with Nodes on path
@return		ADT_List_Stack
Returns path between two Nodes as Stack if way exists .