Once in a while one has a sparse square matrix, and one might wonder if it is a matrix in block form, but permuted. This can be hard to recognize by eye if the matrix is big. It turns out one can determine this VERY quickly. The graph which has an adjacency matrix equal to the matrix under discussion will have a connected component for each block. In fact, a Depth First Search will not only identify the number of connected-components but also their memberships, essentially producing the permutation matrix that we want.
So one could imagine a SAGE command, given a matrix A, that would output the number of blocks, and a permutation matrix P such that PAP^-1 is in block form. Perhaps this is already in SAGE. If not, perhaps I should write it? This came up in a real research problem that a colleague of mine, Prof Robert Lewis, is working on. Surely this small function doesn't really need a package of its own... like the Method of Four Russians got... so how do you handle that? Does it get coded into an existing package? Shall I just write up the pseudocode for one of your more junior project members to code up? Or is this already built-in? Thanks! ---Greg Bard --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---