BioInt
1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
|
00001 #ifndef BIOGRAPH_H 00002 #define BIOGRAPH_H 00003 00004 #include <limits.h> 00005 #include "BioUtilities.h" 00006 00007 using namespace std; 00008 00009 class BioGraph 00010 { 00011 vector<string> node_ids; 00012 int **adj_matrix_; 00013 int minDistance(int dist[],bool sptSet[]); 00014 //vector<int> dijkstra(int** graph,int src, int V); 00015 public: 00016 BioGraph(); 00017 BioGraph(vector<string> nids, int **adj); 00018 BioGraph& operator =(BioGraph& g); 00019 void setGraph(vector<string> nids, int **adj); 00020 void setNodeIds(vector<string> nids); 00021 void setNodeId(int index, string s); 00022 void setAdjacencyMatrix(int **adj); 00023 int ** getAdjacencyMatrix(); 00024 vector<string> getNodeIds(); 00025 string getNodeId(int i); 00026 long getNodeIdIndex(string s); 00027 int getNumberOfEdges();//return total number of edges in the graph 00028 long getNumberOfNodes(); 00029 bool isNeighbor(string n1,string n2); //Given node ids returns if they have an edge or not 00030 bool isNeighbor(long n1in,long n2in); //Same as above but in case indices are given 00031 int getNumberOfNodeEdges(string nid); //returns number of edges given a node id. 00032 void showAdjacencyMatrix(ostream& = cout); 00033 vector<string> getNeighborNodeIds(string n); 00034 float getClusteringCoefficient(string nid); 00035 float getAverageClusteringCoefficient(); 00036 //Network manipulation methods 00037 void addEdge(string n1, string n2); 00038 void deleteEdge(string n1, string n2); 00039 void addNode(string n1); 00040 void deleteNode(string n1); 00041 //To be tested 00042 int getNumberOfSharedNeighbors(string n1, string n2); 00043 vector<string> getSharedNeighborIds(string n1, string n2); 00044 float getTopologicalCoefficient(string ni); 00045 vector<int> getNodeDistances(string n1); 00046 //Returns distance betweein n1 and all the nodes in the graph 00047 //In the same order as node_ids, if distance==INT_MAX, ~ not connected 00048 int getNodeDistance(string n1,string n2); 00049 00050 }; 00051 00052 #endif