/**图灵奖
* WishingBone's ACM/ICPC Routine Library
*
* maximum clique solver
*/
#include <vector>
using std::vector;
// clique solver calculates both size and consitution of maximum clique
// uses bit operation to accelerate searching
// graph size limit is 63, the graph should be undirected
// can optimize to calculate on each component, and sort on vertex degrees
/
/ can be used to solve maximum independent set
class clique {
public:
static const long long ONE = 1;
static const long long MASK = (1 << 21) - 1;
char* bits;
int n, size, cmax[63];
long long mask[63], cons;
// initiate lookup table
clique() {
bits = new char[1 << 21];
bits[0] = 0;
地磁
指数预报for (int i = 1; i < 1 << 21; ++i) bits[i] = bits[i >> 1] + (i & 1); }
~clique() {
}
血管胸// search routine
bool search(int step, int size, long long more, long long con);
时间
统计法// solve maximum clique and return sizeint sizeClique(vector<vector<int> >& mat);
// solve maximum clique and return constitution
vector<int> consClique(vector<vector<int> >& mat);
};
// search routine
// step is node id, size is current solution, more is available mask, cons is constitution mask
非线性薛定谔方程
bool clique::search(int step, int size, long long more, long long cons) {
if (step >= n) {