# Why don't the arrowheads show for this directed graph?

Bug introduced in version 9.0 or earlier and fixed in 10.3

It's very weird, but the first graph is shown as undirected (dots connected by lines, not arrows. The second is shown as directed, with arrows. I'm using the cloud version of Mathematica.

Grafo1=Graph[{1,2,3},{1->2, 3->3, 3->1}]
Grafo2=Graph[{1,2,3},{1->2, 3->3, 3->1, 2->3}]


Anyone has ideas?

• even with Grafo1=Graph[{1,2,3},{1->2, 3->3, 3->1}, DirectedEdges->True] i got the same graph. – asdf Jun 30 '15 at 14:05

## 1 Answer

Both are directed. The arrows are there but they're too small to be visible.

This is because the arrowhead sizes are by default given as a fraction of the image width. Your image is very narrow (and would be even narrower for just Graph[{1 -> 2}]), so the arrowheads become tiny.

Yes, this is not very good design and it's very annoying.

Unfortunately in Mathematica there's no good way to accurately specify the arrowhead size independently of the image width. Here's the relevant question:

The only way is through specifications such as Large, Small, etc., but these are not numeric, and it's sometimes limiting not being able to give more precise values.

So the workaround is:

Graph[{1, 2, 3}, {1 -> 2, 3 -> 3, 3 -> 1}, EdgeStyle -> Arrowheads[Medium]]


You can reliably check if a graph is directed using DirectedGraphQ and UndirectedGraphQ, but note that graphs with no edges are considered both directed and undirected at the same time in Mathematica. Mixed graphs are considered to be neither.

• Ah, good. I don't have to write it up. – rcollyer Jun 30 '15 at 14:11
• lulz, thank you! :D – asdf Jun 30 '15 at 14:12
• @rcollyer Though an arrowhead size specification in (numerical) absolute units would be really-really useful, if that can be arranged :-) – Szabolcs Jun 30 '15 at 14:20