News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Building a Graph data structure in PHP
February 15, 2012 @ 09:35:15

In the latest post to his blog Sameer Borate takes a look at using the Structures_Graph package from PEAR to create data structures in PHP with linked nodes for directed and undirected graphs.

The Pear Structures_Graph package allows creating and manipulating graph data structures. It allows building of either directed or undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing as well as for characteristic extraction from the graph topology.

After sharing the one-line install, he shows how to create some instances of the package's Nodes and how to connect them to a graph and link them to other nodes. He includes a few examples - a simpler one with multiple nodes joined in a directed graph, another showing how to associate data with a node and how to query the graph for node connections and testing to see if the graph is acyclic.

0 comments voice your opinion now!
graph node structure structuregraph pear package tutorial


blog comments powered by Disqus

Similar Posts

Rob Allen: Setting up Zend Server 6 on OS X for PHP development

Amir Saied's Blog: PEAR bash completion

Bertrand Mansion's Blog: Twitter Bootstrap and the QuickForm2 Callback Renderer

Tony Bibbs' Blog: Geeklog_Generator 1.0.0 Released

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?


Community Events





Don't see your event here?
Let us know!


podcast conference voicesoftheelephpant framework api series list symfony deployment language developer interview tips community zendserver laravel introduction library bugfix release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework