-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclique_5.hh
82 lines (71 loc) · 1.8 KB
/
clique_5.hh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef CLIQUE_5_HH
#define CLIQUE_5_HH
namespace cct
{
template< typename Graph >
class Clique_5
{
private:
const Graph graph;
public:
consteval Clique_5( Graph g ) : graph{ g }
{}
int
consteval operator()( void ) const
{
int quantity_cliques = 0;
for( int a = 0; a < size( graph ); ++a )
{
for( int b = 0; b < size( graph ); ++b )
{
if( b == a ||
0 == graph[ a ][ b ] )
{
continue;
}
for( int c = 0; c < size( graph ); ++c )
{
if( c == b ||
c == a ||
0 == graph[ a ][ c ] ||
0 == graph[ b ][ c ] )
{
continue;
}
for( int d = 0; d < size( graph ); ++d )
{
if( d == a ||
d == b ||
d == c ||
0 == graph[ a ][ d ] ||
0 == graph[ b ][ d ] ||
0 == graph[ c ][ d ] )
{
continue;
}
for( int e = 0; e < size( graph ); ++e )
{
if( e == a ||
e == b ||
e == c ||
e == d )
{
continue;
}
if( 1 == graph[ a ][ e ] &&
1 == graph[ b ][ e ] &&
1 == graph[ c ][ e ] &&
1 == graph[ d ][ e ] )
{
++quantity_cliques;
}
}
}
}
}
}
return quantity_cliques;
}
};
}
#endif