src/ADT/Graph/Weighted.php
public function isPath( $source, $target, $hadNodes = array() )
	{
		if( $this->isEdge( $source, $target ) )
			return true;
		$nodes = $this->getTargetNodes( $source );
		$hadNodes[] = $source->getNodeName();
		foreach( $nodes as $node )
			if( !in_array( $node->getNodeName(), $hadNodes ) )
				if( $this->isPath( $node, $target, $hadNodes ) )
					return true;
		return false;
	}
public function isPath( $source, $target, $hadNodes = array() )
	{
		if( $this->isEdge( $source, $target ) )
			return true;
		$nodes = $this->getTargetNodes( $source );
		$hadNodes[] = $source->getNodeName();
		foreach( $nodes as $node )
			if( !in_array( $node->getNodeName(), $hadNodes ) )
				if( $this->isPath( $node, $target, $hadNodes ) )
					return true;
		return false;
	}
public function isPath ( $ source , $ target , $ hadNodes = array ( ) ) { if ( $ this -> isEdge ( $ source , $ target ) ) return true ; $ nodes = $ this -> getTargetNodes ( $ source ) ; $ hadNodes [ ] = $ source -> getNodeName ( ) ; foreach ( $ nodes as $ node ) if ( ! in_array ( $ node -> getNodeName ( ) , $ hadNodes ) ) if ( $ this -> isPath ( $ node , $ target , $ hadNodes ) ) return true ; return false ; }
Ist Weg ?
- ist Folge
- keinen Knoten doppelt besucht
@access		public
@param		ADT_Graph_Node	$source		Source Node of this Edge
@param		ADT_Graph_Node	$target		Target Node of this Edge
@param		array			$hadNodes	Already visited Node.
@return		bool
Ist Weg ? - ist Folge - keinen Knoten doppelt besucht