Вопрос

For my application I need to represent simultaneously (on the same graph) two relations: one is simmetric, the other is not.

Targets:

  • Ideally the two relation should result in edges having different colors;
  • For the symmetric relation I would like not to have double-edges;

Is there a way of doing this with dot?

Это было полезно?

Решение

digraph {

    A; B; C

    subgraph Rel1 {
        edge [dir=none, color=red]
        A -> B -> C -> A
    }

    subgraph Rel2 {
        edge [color=blue]

        B -> C
        C -> A
    }

}

enter image description here

Другие советы

You can pass dir=none as an edge property to the undirected graph connections:

digraph {

    A; B; C
    
    A -> B
    B -> C
    C -> A [dir=none]
}

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top