[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Dima Pasechnik
Ultimately, the classical canonical form/isomorphism implementations run on (di)graphs represented by 0-1 matrices, often with bit entries. So that's how bliss_digraph is represented too. Constructing it directly might be beneficial, especially if you have a problem of doing this on many small ma

[sage-support] Re: cannot install sage: gfortran-7.2.0 failed to build

2018-03-06 Thread Dima Pasechnik
On Tuesday, March 6, 2018 at 11:56:59 PM UTC, Matthew Lancellotti wrote: > > sage: latest version (8.1) (from https://github.com/sagemath/sage, last > updated Dec 17, 2017). tried both master branch and develop branch. > OS: Mac OSX 10.13.3 > Xcode version 9.0.1 > > > I cloned the latest versio

[sage-support] Re: cannot install sage: gfortran-7.2.0 failed to build

2018-03-06 Thread Matthew Lancellotti
Here is the log file: https://drive.google.com/file/d/1zHxRRCueBxlHHI1qp4wfkHAT9yjwaxUG/view?usp=sharing On Tuesday, March 6, 2018 at 6:56:59 PM UTC-5, Matthew Lancellotti wrote: > > sage: latest version (8.1) (from https://github.com/sagemath/sage, last > updated Dec 17, 2017). tried both mast

[sage-support] cannot install sage: gfortran-7.2.0 failed to build

2018-03-06 Thread Matthew Lancellotti
sage: latest version (8.1) (from https://github.com/sagemath/sage, last updated Dec 17, 2017). tried both master branch and develop branch. OS: Mac OSX 10.13.3 Xcode version 9.0.1 I cloned the latest version of sage from the git repository. When attempting to `make` sage, I run into the error

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Hi Simon, Thanks for trying! I was actually hoping for a way to completely avoid creating this sage DiGraph. But either to get the matrix directly into the algorithm (which currently seems impossible), or at least to directly construct some internal graph data structure. Looking at the code of

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Simon King
PS: On 2018-03-06, Simon King wrote: > On 2018-03-06, Christian Stump wrote: > I haven't really been able to work around the bottle neck, but got a > minor improvement (4%) as follows: > ... > And of course using cython helps as well. With the following Cython code, I am > down to 272 µs per loo

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Simon King
Hi Christian, On 2018-03-06, Christian Stump wrote: > Let me add that the situations I care about are n,m <= 20, the entries are ><=5 and the matrices are sparsely filled. An random and typical example is That matrix seems far too small to say anything substantial about timings. However, profil

Re: [sage-support] Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Dear Johan, > The most inefficient part of _matrix_to_digraph seems to be the > following line: > > > x = edge_labels.index((a,b)) > you are totally right, thanks for this suggestion! (Unfortunately, this will not change anything in practice, because the list edge_labels

Re: [sage-support] Graph canonical form directly on matrices

2018-03-06 Thread Johan S. H. Rosenkilde
Hi Christian, The most inefficient part of _matrix_to_digraph seems to be the following line: > x = edge_labels.index((a,b)) which runs in linear time on the length of edge_labels. If all the pairs (a,b) are different on your input matrix, that gives an n^3 running time for t

[sage-support] Re: Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
Let me add that the situations I care about are n,m <= 20, the entries are <=5 and the matrices are sparsely filled. An random and typical example is sage: M = matrix([(0, -1, 0, 0, 0, 0, 0, 1), : (1, 0, 1, 0, 0, 0, 0, 0), : (0, -1, 0, 0, 1, 0, 0, 0), : (0, 0, 0, 0, 0, 1, 0, 0), ..

[sage-support] Graph canonical form directly on matrices

2018-03-06 Thread Christian Stump
(This question is about speed improvements of an existing approach, not about finding a first toy solution.) Let A, B be two ( (n+m) x n ) integer matrices. Say that these are isomorphic if they coincide up to *simultaneous* row and column permutations of the indices 0,...,n-1. Example: [[1,0]