2

Matlab has a function called dmperm that computes the so-called Dulmage–Mendelsohn decomposition of a n x n matrix.

From wikipedia, the Dulmage–Mendelsohn is a partition of the vertices of a bipartite graph into subsets, with the property that two adjacent vertices belong to the same subset if and only if they are paired with each other in a perfect matching of the graph.

Looking both on scipy and numpy, I could not find this function, nor some similar version. Is it possible to implement it using basic linear algebra operations? Any idea if this is implemented in some Python package?

linello
  • 8,451
  • 18
  • 63
  • 109
  • Something like this? http://casadi.sourceforge.net/v3.4.4/api/html/d7/d68/matrix_2btf_8py-example.html Doc: https://web.casadi.org/python-api/#sparsity – max9111 Nov 14 '18 at 12:41

1 Answers1

1

"Any idea if this is implemented in some Python package?"

Well as MATLAB have a Python API, this is definitely a yes. The package is called matlab.engine, and you can see here for installation. Note that you will probably have to install it with sudo rights.

For example usage let A be some matrix, then you can find the dmperm with

import matlab.engine
eng = matlab.engine.start_matlab()
#Define A
B = eng.dmperm(eng.double(A)) #Apply MATLABs dmperm
Nicky Mattsson
  • 3,052
  • 12
  • 28