I fixed the bug but your example still won't work because you can't use \foreach inside \graph. Thank you for your work, that's already progress. Note that the manual explicitly states that \foreach can be used as a <chain specification=""> in graphs: §19.3.2 Syntax of Group Specifications has a paragraph titled "Using foreach".</chain> Best wishes, Gábor
Are you sure that your syntax is right? Yes. Please look at the following places in the manual: Section 19.1 Overview [for specifying graphs]: the last example with edge labels f, a, g. Section 19.2.2: Concept: Chain Groups: the very first example uses a -> {b -> c, d->e } -> f. Section 19.7.3: This section discusses which nodes should be connected by a specification like {a, b, c} -> {d, e->f}. If these do not answer your concerns, please point out the place where you think the syntax is wrong,...
\graph{(1) -> {(2), (3) -> (2)}}; does not connect nodes 1 and 2
\graph{\foreach \x in {1} {(M-1-\x) -- (M-1-2)}}; throws weird TeX error