-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBScan.cpp
More file actions
44 lines (33 loc) · 863 Bytes
/
DBScan.cpp
File metadata and controls
44 lines (33 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include<vector>
using namespace std;
void DBScan(vector<int>D,int eps, int minPoints, vector<int>P){
int c = 0;
for (int i =0; i<P.size();i++){
P[i]= 1;
vector<int> sphere_points = regionQuery(P,eps);
if(sphere_points.size()<minPoints){
continue;
}
else{
c= D[i];
expandCluster(P,sphere_points,c,eps,minPoints);
}
}
}
void expandCluster(vector<int> P,vector<int>sphere_points, int C,int epsilon, int min_points){
for(int i =0; i< sphere_points.size();i++){
if(P[i]!=0){
P[i] =1;
sphere_points=regionQuery(P,epsilon);
if(sphere_points.size()>= min_points){
sphere_points[i]==p;
}
if
}
}
}
vector<int> regionQuery(vector<int>P,int epsilon){
}
int main(){
}