Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath: sage: g=Graph('E{EG').canonical_label() sage: for vertex in g.vertices(): ....: neighbors = g.neighbors(vertex) ....: print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in Nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

I would like to ask if there is a command in SageMath to make it consistent with the Nauty software.

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath: SageMath:

    sage: g=Graph('E{EG').canonical_label()
    sage: for vertex in g.vertices():
    ....:         neighbors = g.neighbors(vertex)
    ....:         print(f"Vertex {vertex}: {neighbors}")

{neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in Nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

I would like to ask if there is a command in SageMath to make it consistent with the Nauty software.

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath:

    sage: g=Graph('E{EG').canonical_label()
    sage: for vertex in g.vertices():
    ....:         neighbors = g.neighbors(vertex)
    ....:         print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in Nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

Is it a bug? I would like to ask if there is a command in SageMath to make it consistent with the Nauty software.

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath:

    sage: g=Graph('E{EG').canonical_label()
    sage: for vertex in g.vertices():
    ....:         neighbors = g.neighbors(vertex)
    ....:         print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in Nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

Is it a bug? I would like to ask if there is a command in SageMath to make it consistent with the Nauty software. software nauty .

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath:

    sage: g=Graph('E{EG').canonical_label()
    sage: for vertex in g.vertices():
    ....:         neighbors = g.neighbors(vertex)
    ....:         print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in Nauty. nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

Is it a bug? I would like to ask if there is a command in SageMath to make it consistent with the software nauty .

The canonical labels in SageMath are different from those in Nauty.

Here are the canonical labels obtained from SageMath:

    sage: g=Graph('E{EG').canonical_label()
    sage: for vertex in g.vertices():
    ....:         neighbors = g.neighbors(vertex)
    ....:         print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

Is it a bug? I would like to ask if there is a command in SageMath to make it consistent with the software nauty .

The canonical labels in SageMath are different from those in Nauty.nauty.

Here are the canonical labels obtained from SageMath:

  sage: g=Graph('E{EG').canonical_label()
  sage: for vertex in g.vertices():
  ....:         neighbors = g.neighbors(vertex)
  ....:         print(f"Vertex {vertex}: {neighbors}")

Vertex 5: [1, 2, 3, 4]
Vertex 1: [5, 2]
Vertex 2: [5, 1]
Vertex 3: [5, 0]
Vertex 0: [3, 4]
Vertex 4: [5, 0]

However, for the same graph, the canonical labels I obtained using nauty are as follows.

echo 'E{EG' |labelg |showg

Graph 1, order 6.
  0 : 4 5;
  1 : 4 5;
  2 : 3 5;
  3 : 2 5;
  4 : 0 1;
  5 : 0 1 2 3;

As we see, the canonical labels in SageMath are different from those in nauty. Consequently, the graph6 strings they produce are also different.

Nauty: E@ro (by running echo 'E{EG' |labelg)

Sage: EK`w (by running Graph('E{EG').canonical_label().graph6_string())

Is it a bug? I would like to ask if there is a command in SageMath to make it consistent with the software nauty .