src/ADT/Graph/DirectedWeighted.php
public function toArray()
	{
		$a = array();
		$nodes = $this->getNodes();
		for( $i=0; $i<$this->getNodeSize(); $i++ )
		{
			$source = $nodes[$i];
			$line = array();
			for( $j=0; $j<$this->getNodeSize(); $j++ )
			{
				$target = $nodes[$j];
				$value = $this->getEdgeValue( $source, $target );
				$line[$target->getNodeName()] = $value;
			}
			$a[$source->getNodeName()] = $line;
		}
		return $a;
	}
public function toArray()
	{
		$a = array();
		$nodes = $this->getNodes();
		for( $i=0; $i<$this->getNodeSize(); $i++ )
		{
			$source = $nodes[$i];
			$line = array();
			for( $j=0; $j<$this->getNodeSize(); $j++ )
			{
				$target = $nodes[$j];
				$value = $this->getEdgeValue( $source, $target );
				$line[$target->getNodeName()] = $value;
			}
			$a[$source->getNodeName()] = $line;
		}
		return $a;
	}
public function toArray ( ) { $ a = array ( ) ; $ nodes = $ this -> getNodes ( ) ; for ( $ i = 0 ; $ i < $ this -> getNodeSize ( ) ; $ i ++ ) { $ source = $ nodes [ $ i ] ; $ line = array ( ) ; for ( $ j = 0 ; $ j < $ this -> getNodeSize ( ) ; $ j ++ ) { $ target = $ nodes [ $ j ] ; $ value = $ this -> getEdgeValue ( $ source , $ target ) ; $ line [ $ target -> getNodeName ( ) ] = $ value ; } $ a [ $ source -> getNodeName ( ) ] = $ line ; } return $ a ; }
Returns all Nodes and Edges of this Graph as an array.
@access		public
@return		array
Returns all Nodes and Edges of this Graph as an array .