1: \documentclass[dvips,a4paper,12pt]{article}
2: \usepackage{amssymb,amsmath,newalg,graphicx}
3: \parindent 0.0 cm
4: %\makeatletter \oddsidemargin 0in \evensidemargin 0in \textwidth16cm
5: %\RequirePackage[dvips]{graphicx} \textheight 20.5cm
6: \setlength\textheight{8.5in} \setlength\textwidth{6.65in}
7: \setlength\topmargin{0.0in}
8: \newtheorem{t1}{Theorem}[section]
9: \newtheorem{p1}{Proposition}[section]
10: \newtheorem{l1}{Lemma}[section]
11: \newtheorem{c1}{Corollary}[section]
12: \newtheorem{d1}{Definition}[section]
13: \newtheorem{r1}{Remark}[section]
14: \newtheorem{co}{Counterexample}[section]
15: \newtheorem{ex}{Example}[section]
16: \newcommand{\singlespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1.5}\tiny\CS}
17: \makeatletter \oddsidemargin -.1in \evensidemargin -.1in \textwidth
18: 16cm \topmargin -.1in \textheight 21cm
19: \renewcommand{\footnotesep}{3.5mm}
20: \newcommand{\doublespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1.35}\tiny\CS}
21: \newcommand{\mb}{\makebox(0,0)}
22: \newcommand{\ve}{\vector(-1,0){.5}}
23: \newcommand{\st}{\shortstack[c]}
24: % Start with double spacing:
25: \doublespacing
26:
27: \newtheorem{theorem}{Theorem}[section]
28: \newtheorem{proposition}[theorem]{Proposition}
29: \newtheorem{corollary}{Corollary}[theorem]
30: \newtheorem{cor}{Corollary}[theorem]
31: \newenvironment{proof}{
32: \noindent\textbf{Proof}\ }{\hspace*{\fill}
33: \begin{math}\Box\end{math}\medskip}
34:
35:
36: \begin{document}
37:
38: %%Title
39: \title{Finding Cliques of a Graph using Prime Numbers}\author{Dhananjay D. Kulkarni$^{a}$, Shekhar Verma$^{a}$, Prashant$^{b}$
40: \thanks{Corresponding author: Dhananjay D. Kulkarni email: dhananjay@iiitm.ac.in}\\
41: $^{a}$Indian Institute of Information Technology and Management,\\
42: Gwalior, India.\\
43: $^{b}$Indian Institute of IT and Management, India.}
44:
45: \date{}
46: \maketitle
47:
48: \begin{abstract}
49: This paper proposes a new algorithm for solving maximal cliques for
50: simple undirected graphs using the theory of prime numbers. A novel
51: approach using prime numbers is used to find cliques and ends with a
52: discussion of the algorithm.
53: \end{abstract}
54:
55: \section{Introduction:}
56: Graph-theoretic clustering techniques find their application in
57: myriad of problems in information science. One such technique is
58: finding all the cliques (maximal complete subgraphs) of a given
59: graph. A first general algorithm which enumerates all cliques of the
60: graph was given by Bierstone[1]. The Bierstone algorithm attempts to
61: find the cliques of the current node and its neighboring nodes which
62: can be merged with the subgraphs already generated to give the
63: maximal sub graph of the graph. A correction of the Bierstone's
64: algorithm was proposed by Gordon D. Mulligan and D.G. Corneil in
65: 1972[2]
66:
67: In this paper we propose a new notation for graphs using prime
68: numbers[3]. This is followed by an algorithm to enumerate all the
69: cliques of a general graph. The paper is commenced by a discussion.
70:
71: \section{Notation Used:}
72: In general we consider a graph given by $G(V,E)$. Each vertex $u \in
73: V$ is identified by a unique prime number denoted by $v_u$. Every
74: vertex $u$, has a weight, denoted by $w_u = \prod_{i \in N[u]} v_i$
75: where $N[i]$ is the closed set of all vertices adjacent to $i$[4].
76:
77: \begin{theorem}[Fundamental Theorem of Arithmetic]
78: \label{thm_FTOA}
79: Every positive number greater than $1$ can be written as a product of prime numbers in only one way.
80: \end{theorem}
81:
82: \begin{corollary}
83: \label{cor_prime_divisor}
84: If $p,q_1,q_2, \ldots , q_n$ are all primes and $p \vert q_1 q_2 \cdots q_n$ then $p = q_k$ for some $k$ where $1 \leq k \leq n$.
85: \end{corollary}
86:
87: \begin{proposition}
88: \label{prop_adj}
89: If $v_i \vert w_j$, there exists an edge from $j$ to $i$.
90: \end{proposition}
91:
92: \begin{proof}
93: $w_j = \prod_{u \in N[v]} v_u$. From \ref{cor_prime_divisor} and the fact that $v_i$ is prime, $v_i = v_u$ for some $u \Rightarrow i \in N[j]$.
94: \end{proof}
95:
96: Consider $g = \gcd(w_i, w_j)$. Using \ref{thm_FTOA} we can factorise $g$ in unique primes common to both $w_i$ and $w_j$. These are values of vertexes common to both $i$ and $j$.
97:
98: \begin{proposition}
99: A clique can be uniquely identified by the product of the values of its participating vertices.
100: \end{proposition}
101:
102: \begin{proof}
103: A clique is identified by the vertices participating in it. The value of each vertex is a unique prime. Thus the product is also unique.
104: \end{proof}
105:
106: \section{Algorithm:}
107:
108: \subsection{Theme:}
109:
110: A graph is represented by a list $Q$ of tuples $\{v_u, w_u\}$ where each tuple represents a vertex. A vertex participates in all the cliques of its induced subgraph. Hence any arbitrary vertex is chosen as \textbf{pivot} - $p$ and two graphs (lists) are generated. $LeftQ$ represents the induced subgraph of pivot. $RightQ$ represents the subgraph in which pivot doesnot participate in any clique.
111:
112: Consider any arbitrary vertex $u$. If $u \in N[p] \Rightarrow v_p \vert w_u$:
113: \newline
114: \newline
115: \textit{Case 1: For every clique in which $u$ participates, pivot is
116: one of the vertex.} This implies that $N[u] \subseteq N[p]
117: \Rightarrow w_u \vert w_p$. Thus $u \in LeftQ$. In the induced
118: subgraph, the neighborhood of $u$ is $N[u] - p$. Hence $w_u =
119: w_u/v_p$.
120: \newline
121: \newline
122: \textit{Case 2: For some cliques in which $u$ participates, pivot is
123: one of the vertex.} This implies that $N[u] \nsubseteq N[p]$ but
124: $N[u] \cap N[p] \neq \phi$. Here, $u \in LeftQ \wedge u \in RightQ$.
125: Two vertices $u_L$ and $u_R$ are created for $LeftQ$ and $RightQ$
126: respectively where $v_{u_L} = v_{u_R} = v_u$. $N[u_L] = N[u] \cap
127: N[p] - p \Rightarrow w_{u_L} = \gcd(w_u, w_p)/v_p$. $N[u_R] = N[u] -
128: p $, all vertices that fall in case 1.
129: \newline
130: \newline
131: Else, $u \in RightQ$. The cliques of the graphs thus generated are
132: found out by recursion. The terminating condition is a single vertex
133: or a null graph. The pivot is added to all the cliques of the
134: induced subgraph ($LeftQ$).
135:
136: \subsection{Merging of vertices:}
137:
138: If two vertices have the same neighborhood, they participate in the same cliques.
139: Hence, such vertices can be logically considered as a single vertex. Thus, if there exist $u_1, u_2 \ldots u_n$ such that $w_{u_1} = w_{u_2} = \ldots = w_{u_n}$, they can be merged in one vertex $u_m$ such that $v_{u_m} = v_{u_1} \times v_{u_2} \times \ldots \times v_{u_n}$ and $w_{u_m} = w_{u_1}$. Logically speaking, $u_m$ represents a clique $\{u_1, u_2 \ldots u_n\}$. A normal case would demand $n$ recursions (one for every vertex) against a single recursion after merging. Thus, if given graph is a clique, the vertices will coalesce into a single vertex reducing the amount of computation drastically. \\
140: \newline
141: \newline
142:
143: \subsection{Algorithm is given below:}
144:
145: \begin{algorithm}{Find-Clique}{Q}
146: CliqueQ \= \NIL \\
147: \CALL{Sort-By-Weight}(Q) \\
148: \begin{IF}{\vert Q \vert =\ 0}
149: \RETURN CliqueQ
150: \end{IF} \\
151: \begin{FOR}{i \= 1 \TO \vert Q \vert} \\
152: \begin{WHILE}{w_{Q[i]} =\ w_{Q[i+1]}}
153: v_{Q[i]} \= v_{Q[i]} \times v_{Q[i+1]} \\
154: \CALL{Remove}(Q, Q[i+1])
155: \end{WHILE}
156: \end{FOR} \\
157: \begin{IF}{\vert Q \vert =\ 1}
158: \CALL{Insert}(CliqueQ, v_{Q[1]}) \\
159: \RETURN CliqueQ
160: \end{IF} \\
161: p \= Q[1] \\
162: LeftQ, RightQ, PivotQ \= \NIL \\
163: \begin{FOR}{j \= 2 \TO \vert Q \vert}
164: \begin{IF}{v_{p} \vert w_{Q[j]}}
165: w_{Q[j]} \= w_{Q[j]}/v_{p} \\
166: \begin{IF}{w_{Q[j]} \vert w_{p}}
167: \CALL{Insert}(LeftQ, Q[j]) \\
168: \CALL{Insert}(NewQ, Q[j])
169: \ELSE
170: n_L, n_R \= \NIL \\
171: v_{n_L}, v_{n_R} \= v_{Q[j]} \\
172: w_{n_L} \= \CALL{GCD}(w_{p}, w_{Q[j]}) \\
173: w_{n_R} \= w_{Q[j]} \\
174: \CALL{Insert}(LeftQ, n_L), \CALL{Insert}(RightQ, n_R)
175: \end{IF}
176: \ELSE
177: \CALL{Insert}(RightQ, Q[j])
178: \end{IF}
179: \end{FOR} \\
180: \begin{FOR}{i \= 1 \TO \vert RightQ \vert}
181: \begin{FOR}{j \= 1 \TO \vert PivotQ \vert}
182: \begin{IF}{v_{PivotQ[j]} \vert w_{RightQ[i]}}
183: w_{RightQ[i]} \= w_{RightQ[i]}/v_{PivotQ[j]}
184: \end{IF}
185: \end{FOR}
186: \end{FOR} \\
187: LeftCliqueQ, RightCliqueQ \= \NIL \\
188: LeftCliqueQ \= \CALL{Find-Clique}(LeftQ) \\
189: RightCliqueQ \= \CALL{Find-Clique}(RightQ) \\
190: \begin{FOR}{i \= 1 \TO \vert LeftCliqueQ \vert}
191: LeftCliqueQ[i] \= LeftCliqueQ[i] \times v_p
192: \end{FOR} \\
193: CliqueQ = LeftCliqueQ + RightCliqueQ \\
194: \RETURN CliqueQ
195: \end{algorithm}
196:
197: \subsection{Explanation of the algorithm:}
198:
199: Initially all the tuples are sorted by weight to facilitate
200: identification of vertices having same neighborhood if so then they
201: are merged. If the input graph was a single vertex or a clique, the
202: degree of graph reduces to one after merging. The algorithm
203: terminates here reporting the value of the vertex as the clique in
204: the graph.
205:
206: If the given graph is not a clique, then the first element is chosen
207: as the pivot. Based on this pivot, the graphs $LeftQ$ and $RightQ$
208: are generated. All the vertices belonging to \textit{case 1} are
209: also stored in $PivotQ$. These are then eliminated one-by-one from
210: the neighborhood of the vertices in $RightQ$. The cliques of
211: subgraphs $LeftQ$ and $RightQ$ are found out using recursion. The
212: pivot is then added to every clique of $LeftQ$. The two lists of
213: cliques are merged and the algorithm terminates.
214:
215: \subsection{Analysis:}
216:
217: The best case is when the given graph $G(V, E)$ is a clique
218: $C_{\vert V \vert}$. Then all the vertices merge into a single
219: vertex. The time required to find the clique then depends only upon
220: the time required to sort the vertices on the basis of their weight.
221: Using quick sort, best case complexity converges to $O(n \log(n))$.
222:
223: The choice of the pivot governs the two subgraphs generated. Hence
224: if the \textit{pivot} is chosen such that that we have the induced
225: subgraph of order $\vert V \vert - 2$ and the other subgraph of
226: order $\vert V \vert - 1$. Such a case will occur only when the
227: \textit{pivot} participates in a clique with every other vertex
228: except one, say $y$ and $y$ participates with every other vertex
229: except \textit{pivot}. This gives,
230:
231: \begin{equation*}
232: T(n) = T(n-2)+T(n-1)=O(2^n).
233: \end{equation*}
234:
235: Thus the worst case complexity converges to $O(n)$.
236:
237: \section{Conclusion:}
238:
239: The theory of prime numbers can be used to perform simple set
240: operations like union and intersection using arithmetic functions
241: like gcd (greatest common divisor) and lcm(least common multiple).
242: The major drawback of this method is its storage space, while it
243: scores on simplicity.
244:
245: Applying this principle to the theory of graphs, we can compute all
246: the maximal subsets of the graph efficiently by removing the
247: unwanted vertices by the process of merging, thus reducing the
248: complexity for some special type of graphs to $O(n \log(n))$.
249:
250: More work however remains to be done. This spans the complexity in the average case, and also
251: possibility of a heuristic on choosing the $pivot$ such that the generated subgraphs
252: are more or less mutually exclusive.
253: \newline
254: \newline
255: \textbf{Acknowledgements:} We here by dedicate this work to Almighty
256: in full faith. We also acknowledge Dr. Shekhar Verma for his
257: guidance and support all through the research. Acknowledgements are
258: also due to Indian Institute of IT and Management, Gwalior, India
259: for extending all facilities and support in the completion of this
260: work.
261:
262: \section{References:}
263: [1] J. Gary Auguston and Jack Minker \textbf{An Analysis of Some
264: Graph Theoretical Cluster Techniques}, Journal of the Association
265: for Computing Machinery, Vol. 17, No.5 October 1970, pp.571-588
266:
267: [2] Gordon D. Mulligan and D.G. Corneil \textbf{Corrections to
268: Bierstone's Algorithm for Generating Cliques}, Journal of the
269: Association for Computing Machinery, Vol. 19, No.2, April 1972,
270: pp.244-247
271:
272: [3] David M. Burton \textbf{Elementary Number Theory}, Universal
273: Book Publishers, New Delhi 1997.
274:
275: [4] Douglas B. West \textbf{Introduction to Graph Theory}, Prentice
276: Hall of India, New Delhi 2003.
277: \end{document}
278: