SourceForge.net Logo hgraph

About Documentation hgv Screencaps Project Info Links
It's prolly easiest to start with a small example.
#include <hgraph.hpp>; using namespace hypergraph; typedef hgraph<> hgraph_type; typedef hgraph_type::vertex_handle_type vertexHandle; typedef hgraph_type::edge_handle_type edgeHandle; typedef hgraph_type::port_handle_type portHandle; int main(int argc, char** argv) { hgraph_type graph; vertexHandle v1, v2; edgeHandle e1; portHandle p1, p2; v1 = graph.new_vertex(); v2 = graph.new_vertex(); e1 = graph.new_edge(); p1 = graph.connect(v1, e1); p2 = graph.connect(v2, e1); return 0; }

And that's it. You now have a graph with two vertices and one edge connecting them. Now lets name the vertices.

v1.set_attribute("name", "root");

The vertex refered to by v1 now has a attribute named "name" whith a value of "root". Attributes can be set on vertices, edges, ports, and on the graph itself.