Hei, Glenn. I will put a short program here to reoorder a 0/1 data table
into a more systematic way. There is a nice mathematical theory behind it
(so-called Monotone Systems) but our forum is not the place to write about
it.
ta=. "."0;._2'01000000011 10000111111 00011111111 00101111111 00110111111
01111011110 01111101110 01111110101 01111111001 11111110001 11111001110 '
th=:13 :'s;(>1{y),w[[s=:(100000)w}(s-(<[w=:{./:s=:>0{y){x)'
ty=: 13 :'>1{y th^:(#y)(+/y);0$0'
z=.ty zz=.ta +/ .*|:ta
h=.ty hh=.(|:ta)+/ .*ta
p=.(((,.h;(h([{])"1(z([{])ta)));,.(3#999),z))
There are some obvious modifications. First, in z and h calculations you
can use instead of * the comparison =
Second, for a symmetric table (graph's adjacency matrix- as in my
example) z and h are identical, so you calculate only one of them and
correct the printing sentence accordingly.
Using = you can reorder any nominal discrete data table effectively (any
number of values classes, not only 0/1).
There are some finesses for better data inner compacting, but those need
more complicated programming. I believe that having p table before your
eyes one can easily find which additional rows or columns could suit your
biggest pattern.
In my practice (last 40 years) this reordering has always opened the inner
strucure of a data table clearly enough for practical needs.
WbR Leo
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm