I'm working on an application that simulates several components
interacting with each other. I would like to represent this situation
using a graph, where each component is a vertex and the interaction of
2 components is an edge between them.

I've taking using RGL [0] to handle graphs and it seems very nice.
However, I don't find a way to add a label or a list of labels to the
edges.

Have I overlooked this functionality in RGL? Can you suggest an
alternative lib to handle graphs?

I've just recently worked on something similar (making a picture of
the graph of components configured in an XML file). I ended up using
GRATR, which is just a fork of RGL: http://gratr.rubyforge.org/ It
also didn't seem to handle the labels for edges, so I used the
DOT::DOTDigraph class directly instead of the actual graph object.

I added the following directly to that class to get the output using
DOT functionality:

I'm working on an application that simulates several components
interacting with each other. I would like to represent this situation
using a graph, where each component is a vertex and the interaction of
2 components is an edge between them.

I've taking using RGL [0] to handle graphs and it seems very nice.
However, I don't find a way to add a label or a list of labels to the
edges.

Have I overlooked this functionality in RGL? Can you suggest an
alternative lib to handle graphs?

The main features are:
* a vertex can be any Ruby object
* a vertex can be part of many graphs (see Vertex#each_graph)
* edges can be decorated ('info' parameter to Graph#link and Vertex#[])
* availability of basic boost::graph algorithms: component, DFS, BFS. I
usually add more when I need them ...

You can also check Roby::RelationGraph and Roby::DirectedRelationSupport,
which are specific extensions to the graph API I use for the Roby project.

If you find it useful, I can create a separate project for it.

Using GRATR, you can add labels to the edges of the graph by adding a
third parameter when you do that add_edge! which is a Hash of options
for that edge. E.g. g.add_edge!(node1, node2, :label => "My edge
label")