src/ADT/Graph/Weighted.php
public function toList()
	{
		$list = array();
		$nodes = $this->getNodes();
		foreach( $nodes as $source )
		{
			$sublist = array();
			foreach( $nodes as $target )
			{
				if( $this->isEdge( $source, $target ) )
					$sublist[$target->getNodeName()] = $this->getEdgeValue( $source, $target );
			}
			$list [$source->getNodeName()] = $sublist;
		}
		return $list;
	}
public function toList()
	{
		$list = array();
		$nodes = $this->getNodes();
		foreach( $nodes as $source )
		{
			$sublist = array();
			foreach( $nodes as $target )
			{
				if( $this->isEdge( $source, $target ) )
					$sublist[$target->getNodeName()] = $this->getEdgeValue( $source, $target );
			}
			$list [$source->getNodeName()] = $sublist;
		}
		return $list;
	}
public function toList ( ) { $ list = array ( ) ; $ nodes = $ this -> getNodes ( ) ; foreach ( $ nodes as $ source ) { $ sublist = array ( ) ; foreach ( $ nodes as $ target ) { if ( $ this -> isEdge ( $ source , $ target ) ) $ sublist [ $ target -> getNodeName ( ) ] = $ this -> getEdgeValue ( $ source , $ target ) ; } $ list [ $ source -> getNodeName ( ) ] = $ sublist ; } return $ list ; }
Returns all Nodes and Edges of this Graph as list.
@access		public
@return		array
Returns all Nodes and Edges of this Graph as list .