-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdjacencyGraph.H
37 lines (32 loc) · 1.07 KB
/
AdjacencyGraph.H
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
/****************************************************************
AdjacencyGraph.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#ifndef INCL_AdjacencyGraph_H
#define INCL_AdjacencyGraph_H
#include <iostream>
#include "Graph.H"
#include "Array2D.H"
using namespace std;
namespace BOOM {
class AdjacencyGraph : public Graph
{
public:
AdjacencyGraph(int numVertices);
virtual Neighborhood *getNeighborsOf(VertexId,bool &shouldDelete) const;
virtual VertexId addVertex();
virtual bool areAdjacent(VertexId,VertexId) const;
virtual int getDegree(VertexId) const;
virtual int getNumEdges() const;
virtual int getNumVertices() const;
virtual void addEdge(VertexId from,VertexId to);
virtual void removeEdge(VertexId from,VertexId to);
private:
Array2D<bool> M; // adjacency matrix
int numVertices, numEdges;
};
}
#endif