From b59602264cc9c06197fd88d1a5ce438e1d06df43 Mon Sep 17 00:00:00 2001 From: Anuj Thakur Date: Wed, 25 Mar 2026 14:28:00 +0000 Subject: [PATCH] Fix: faulty encoding without faithfulness --- gap/io.gi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gap/io.gi b/gap/io.gi index e29ba45f8..338c7b880 100644 --- a/gap/io.gi +++ b/gap/io.gi @@ -2281,6 +2281,15 @@ function(D) # matrix, and appends a '&' to the start. The old '+' format can be read by # DigraphFromDigraph6String, but can no longer be written by this function. + if IsMultiDigraph(D) then + if IsSymmetricDigraph(D) then + ErrorNoReturn("the argument must not have multiple edges ", + "consider encoding in Sparse6 or Disparse6, "); + fi; + ErrorNoReturn("the argument must not have multiple edges ", + "consider encoding in Disparse6, "); + fi; + list := []; adj := OutNeighbours(D); n := Length(DigraphVertices(D)); @@ -2338,7 +2347,11 @@ function(D) local list, n, lenlist, adj, nredges, k, blist, v, nextbit, i, j, bitstopad, pos, block; if not IsSymmetricDigraph(D) then - ErrorNoReturn("the argument must be a symmetric digraph,"); + if IsMultiDigraph(D) then + ErrorNoReturn("the argument must be a symmetric digraph consider encoding in Disparse6,"); + fi; + else + ErrorNoReturn("the argument must be a symmetric digraph consider encoding in Digraph6 or Disparse6,"); fi; list := [];