-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvertex.h
More file actions
51 lines (44 loc) · 900 Bytes
/
Copy pathvertex.h
File metadata and controls
51 lines (44 loc) · 900 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
45
46
47
48
49
50
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <stack>
#include <vector>
using namespace std;
#define TAG_SEPARATOR "_"
#define CO_OCCURENCE_WINDOW 3
#define NO_ITERATIONS 30
class Neighbour{
public:
int vertexId;
float weight;
Neighbour *nextNeighbour;
Neighbour(int vertexNo){
vertexId = vertexNo;
weight = 1.0;
nextNeighbour = NULL;
}
};
class Vertex{
public:
string value;
int position;
int gposition;
float score;
Neighbour *neighbour;
Vertex(string vertexVal, int pos, int gpos){
value = vertexVal;
position = pos;
gposition = gpos;
score = 1.0;
neighbour = NULL;
}
void addNeighbour(int);
void showNeighbours();
int count_neighbours();
};
void init();
void displayAdjList(vector<Vertex*>);
void depthFirstTraversal(vector<Vertex*>);
bool filter_tag(string);
int exist_word(vector<Vertex*> adjList, string word);