⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graph.cpp

📁 clustering for ns-2 simulation
💻 CPP
字号:
#include <fstream>#include <sstream>#include "graph.h"#include "verifier.h"void cancelNode(int node, Graph & graph){	for (NodeList::iterator n = graph[node].begin(); n != graph[node].end(); n++)		graph[*n].erase(node);	graph.erase(node);}void changeToGraph(string & fileName) {    istringstream in(fileName);    string tmp;    getline(in, tmp, 'S');    in >> tmp;    tmp = "graphS" + tmp;    fileName = tmp;}void connect(int nodeA, int nodeB, Graph & graph){    graph[nodeA].insert(nodeB);    graph[nodeB].insert(nodeA);}//// Calcola il numero di links e il degree di un grafo.//void countLinks(Graph & graph, int & links) {    links = 0;    for (Graph::iterator i = graph.begin(); i != graph.end(); i++)        links += (i->second).size();    links = links / 2;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -