Concentrate vs. labels

Can someone here help me understand the dot behavior that I’m seeing?

If I render this digraph using dot:

digraph "concentrate test" {
	graph [fontname=Arial rankdir=LR concentrate=true]
	node [fontname=Futura shape=Mrecord]
        subgraph "cluster_Concentrate test Sub 1" {
            graph [fontname=Arial rankdir=LR]
            node [fontname=Futura shape=Mrecord]
            AAA
            AAA -> b
            AAA -> c
            AAA -> d
            AAA -> e
            AAA -> g [label=“1”]
            1 -> b
        }
}

dot -Tsvg concentrate_test.tree > concentrate_test.svg

I get this (expected):
concentrate_test

If I now remove the substring: [label=“1”], and render with the same command line, I get this (unexpected):

concentrate_test_nolabel

Why does removing the label break edge concentration?

thanks,

Joe

It is a bug. Maybe related to this (closed) Issue.
I encourage you to report it here.
Here is a workaround:

digraph "concentrate test" {
	graph [fontname=Arial rankdir=LR concentrate=true]
	node [fontname=Futura shape=Mrecord]
        subgraph "cluster_Concentrate test Sub 1" {
            graph [fontname=Arial rankdir=LR]
            node [fontname=Futura shape=Mrecord]
            AAA
            AAA -> b
            AAA -> c
            AAA -> d
            AAA -> e
            AAA -> g  [label=" "]
            1 -> b
        }
}

Giving:

Hi Steve,

Thanks for the workaround. But it only works for that one specific case. If I try to generalize that workaround by always adding empty labels to all edges, I still see the problem:

digraph "concentrate test" {
	graph [rankdir=LR concentrate=true]
    subgraph "cluster_Concentrate test Sub 1" {
        a
        b
        c
        d
        e
        f
        a -> b [label=" "]
        a -> c [label=" "]
        d -> e [label=" "]
        d -> f [label=" "]
    }
}

concentrate_test

I have simplified the example:

[dot]
digraph “concentrate test” {
graph [rankdir=LR concentrate=true]
a → b
a → c
}
[/dot]

This is in graphviz version 12.1.2 (20240928.0832)

I’ve filed an issue here: concentrate=true not working in 12.1.2 (20240928.0832) (#2627) · Issues · graphviz / graphviz · GitLab

New workaround added minlen to increase spacing (lucky guess):

digraph "concentrate test" {
  graph [rankdir=LR concentrate=true]
  subgraph "cluster_Concentrate test Sub 1" {
    a
    b
    c
    d
    e
    f

    edge [minlen=2]
    a -> b [label="1"]
    a -> c [label="2"]
    d -> e [label=" "]
    d -> f [label=" "]
    g -> h 
    g -> i
  }
}

Giving:

I am assuming it is unintentional your original input uses smart quotes? label=“1” will not work, whereas label="1" should.