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

📄 testmaxprofitbbmaxclique.cpp

📁 这是数据结构、算法与应用-C++语言描述的代码
💻 CPP
字号:

// test adjacencyGraph::maxProfitBBMaxClique

#include <iostream>
#include <iterator>
#include "adjacencyGraph.h"
#include "unweightedEdge.h"

using namespace std;

void main(void)
{
   // input a test graph
   cout << "Enter number of vertices and edges" << endl;
   int n, e;
   cin >> n >> e;
   adjacencyGraph g(n);

   for (int i = 1; i <= e; i++)
   {
      cout << "Enter edge " << i << endl;
      int u, v;
      cin >> u >> v;
      g.insertEdge(new unweightedEdge(u, v));
   }
   cout << "The undirected graph is" << endl;
   g.output(cout);

   int *c = new int [n + 1];
   cout << "The max clique size is " << g.maxProfitBBMaxClique(c) << endl;
   cout << "The vertex selection vector is ";
   copy(c + 1, c + n + 1, ostream_iterator<int>(cout, "  "));
   cout << endl;
}

⌨️ 快捷键说明

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