-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.h
More file actions
48 lines (42 loc) · 1.17 KB
/
Node.h
File metadata and controls
48 lines (42 loc) · 1.17 KB
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
#pragma once
#include "EdgeEntry.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <iostream>
#include <math.h>
using namespace std;
//The node class represents a node in the graph
//It holds all the relevant node paramaters (label, edge list)
class Node
{
public:
Node();
bool operator> (const Node* node) const;
bool operator< (const Node* node) const;
int getDegree() { return degree; }
void setDegree(int deg) { degree = deg; }
int getLabel() { return label; }
void setLabel(int lab) { label = lab; }
int getExcess() { return excess; }
void setExcess(int exc) { excess = exc; }
void incExcess(int value) { excess += value; }
void decExcess(int value);
int getID() {return id; }
void setID(int node_id) { id = node_id; }
EdgeEntry* getAdjList() { return adjList; }
EdgeEntry* getLastEdge() { return lastEdge; }
void incNumEdges() { numEdges++; }
int getNumEdges() { return numEdges; };
void addEdge(EdgeEntry* edge);
void printNode(ofstream & output);
void debugNodeDump();
private :
int degree;
int label;
int excess;
int id;
int numEdges;
EdgeEntry *adjList;
EdgeEntry *lastEdge;
};