Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am learning about sparse matrices and the two level algorithm and PCG algorithm. Below are instructions on a project I am working on. I
I am learning about sparse matrices and the two level algorithm and PCG algorithm. Below are instructions on a project I am working on. I need help implementing this project in python. I want a step by step explanation and a running code. I am not turning this in I just need help because I don't have python experience. Notes and instructions to the project are provided in the screenshots. For the graph to use, use the one i provided in text format called karate club.
(I) Load a graph in terms of its adjacency matrix in Coo format. Construct the graph Laplacian matrix L. Compute its three smallest eigenvalues and corresponding eigenvectors 90, 91, 92. Disregard qo (which is the normalized constant vector). Embed the graph vertices in R using the rows of the matrix Q = [91, 92]. Then, for a given ne (a number smaller than n -the size of the graph), construct K = ne clusters (or aggregates) using the K-means algorithm. Write the relation "vertex-aggregate" as a nx ne sparse matrix P (it has nonzero values : 1 at row i and column j if vertex i belongs to aggregate j). - (II) Consider the s.p.d. matrix A = L + 0.01I ( a shifted graph Laplacian to make it s.p.d.). Implement the TL algorithm (description attached in separate file) BTL based on A, P, and Ac PT AP. = (III) Implement the preconditioned CG algorithm (description attached in separate file). Use the two-level preconditioner B BTL in the PCG to solve systems Ax = b. Some details about graphs and embedding are found on the following page. =
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started