src/ADT/Graph/Weighted.php
public function makeTransitive()
	{
		$nodes = $this->getNodes();
		foreach( $nodes as $source )
		{
			foreach( $nodes as $target )
			{
				if( $source != $target && $this->isEdge( $source, $target ) )
				{
					$value1 = $this->getEdgeValue( $source, $target );
					foreach( $nodes as $step )
					{
						if( $source != $step && $target != $step && $this->isEdge( $target, $step ) )
						{
							$value2 = $this->getEdgeValue( $target, $step );
							if( $this->getEdgeValue( $source, $step ) != ( $value1 + $value2 ) )
								$this->addEdge( $source, $step, $value1 + $value2 );
						}
					}
				}
			}
		}
	}
public function makeTransitive()
	{
		$nodes = $this->getNodes();
		foreach( $nodes as $source )
		{
			foreach( $nodes as $target )
			{
				if( $source != $target && $this->isEdge( $source, $target ) )
				{
					$value1 = $this->getEdgeValue( $source, $target );
					foreach( $nodes as $step )
					{
						if( $source != $step && $target != $step && $this->isEdge( $target, $step ) )
						{
							$value2 = $this->getEdgeValue( $target, $step );
							if( $this->getEdgeValue( $source, $step ) != ( $value1 + $value2 ) )
								$this->addEdge( $source, $step, $value1 + $value2 );
						}
					}
				}
			}
		}
	}
public function makeTransitive ( ) { $ nodes = $ this -> getNodes ( ) ; foreach ( $ nodes as $ source ) { foreach ( $ nodes as $ target ) { if ( $ source != $ target && $ this -> isEdge ( $ source , $ target ) ) { $ value1 = $ this -> getEdgeValue ( $ source , $ target ) ; foreach ( $ nodes as $ step ) { if ( $ source != $ step && $ target != $ step && $ this -> isEdge ( $ target , $ step ) ) { $ value2 = $ this -> getEdgeValue ( $ target , $ step ) ; if ( $ this -> getEdgeValue ( $ source , $ step ) != ( $ value1 + $ value2 ) ) $ this -> addEdge ( $ source , $ step , $ value1 + $ value2 ) ; } } } } } }
Sets transitive closure with values with Warshall algorithm.
@access		public
@return		void
Sets transitive closure with values with Warshall algorithm .