Log in

View Full Version : Computational Topology - Vietoris-Rips Complex


moh533
Sep 14, 2017, 09:12 PM
Write code for the function RipsComplex(P,d).

- Inputs:

- P : a set of points P belonging to R2 given as a k x 2 numpy matrix
- d : a diameter d >= 0

- Output:

- The boundary matrix representing the 3-skeleton of VR(P, d).


Note: I have little to no programming skills, so I'm just learning. Please bear with me. Also, this question is very similar to the previous question I posted. However, a graph does not need to be generated.. rather a 3-skeleton boundary matrix in python.


Here's my work so far (same as previous question):


import numpy as np
import networkx as nx
P = np.random.random((15,2)) #each point is row in matrix
from scipy.spatial import distance-matrix
plt.matshow(distance-matrix(P,P))
row,col = np.where(D<???) #must find point with distance <???... not sure what distance to use
print(row[:10],'\n',col[:10]) - slicing matrix


#Next, I must remove duplicates and any point where col>row.. by slicing the matrix with specific parameters..


Any help is greatly appreciated. Thanks!

smoothy
Sep 14, 2017, 09:37 PM
Homework rules on this site REQUIRE you provide your works AND what you think the answer is. You forgot to cut and paste those.

moh533
Sep 15, 2017, 07:00 AM
Edited