Alternate partitioning method

22 views
Skip to first unread message

Steven Dalton

unread,
Jul 15, 2012, 5:00:25 AM7/15/12
to pyamg...@googlegroups.com
I've been playing around with the partitioning example and LOBPCG.
It's great when it works but unpredictable at times. I've attached an alternative method
based on isoperimetric partitioning that works well though the results may not be as
desirable since it doesn't guarantee connectivity of one of the partitions. The method
randomly selects a node and assigns it to a partition which makes the system nonsingular
and uses CG to solve for the resulting partition.

Anyway, just an idea for a alternative example.

Here's a link to the paper:

Regards,
  Steve
demo.py
helper.py

Steven Dalton

unread,
Jul 19, 2012, 11:56:56 PM7/19/12
to pyamg...@googlegroups.com
It's not based on any well posed principles but the following code seems to allow LOBPCG to execute without failure from my tests.

# small random perturbation of A diagonals
N = A.shape[0]
data = 10.0**-numpy.random.randint(8,16,size=N)
D = coo_matrix((data,(numpy.arange(N),numpy.arange(N))),A.shape)
A = A + D

# construct preconditioner
ml = smoothed_aggregation_solver(A, coarse_solver='pinv2',max_coarse=10)
M = ml.aspreconditioner()

# solve for lowest two modes: constant vector and Fiedler vector
X = scipy.rand(A.shape[0], 2)

# specify lowest constant eigenvector and orthonormalize Fiedler against it
X[:,0] = numpy.ones((A.shape[0],))
X = numpy.linalg.qr(X, mode='full')[0]

(eval,evec,res) = lobpcg(A, X, M=M, tol=1e-12, largest=False, \
        verbosityLevel=0, retResidualNormsHistory=True)
Reply all
Reply to author
Forward
0 new messages