Can I build a partially directed graph?

I would like to create a SQL Diagram which has a node for each table in the query and an edge between nodes that are joined by a predicate. An edge is directed if it points into a unique key of the joined table. Most joins flow from a child node into a unique key of the parent (A One-to-Many join). Sometimes the join is from one unique key to another and create a One-to-One join. I can cover this case by simply creating two edges. The problematic case is when a join doesn't have a unique key on either end. In this case it's a Many-to-Many join. Of course it's a non-directed graph at that point. The diagram is a "mostly" directed graph and I want to take advantage of the dot plotting with its directed flow. Is there a way to build a partially directed graph like this?

Edit:

The documentation reveals that I might be able to do this by setting the "dir" attribute to none for drawing arrows, though the edge still has a direction.  I suppose I could try to force the two nodes to be on the same level so they are drawn with a horrizontal connection.

I think I can also get a double arrow head line for a One-to-One connection by setting "dir" to both.

You've mostly answered your

You've mostly answered your own question. Graphviz only supports directed or undirected graphs, not allowing a mixture of edges, but the main effect is with the default settings, with edges in directed graphs  having an arrowhead at the head node. (It also affects edge lookup, but users don't usual deal with this.) But which ends of an edge get a directional decoration and what type is totally under your control with the dir, arrowhead and arrowtail attributes. The layout algorithms also work with any type of graph. Most simply ignore edge direction, where dot uses the implcit direction (a -- b is treated like a-> b) for undirected graphs.

Can I build a partially directed graph?

Presumably the other way is to use the arrowsize attribute, and to make it 0 when you want to emulate an undirected graph.

 

Recent comments