I want to find the largest clique containing certain vertex in a connected graph. In the wiki it said a maximal clique can be found by greedy search. However, this can't ensure that you find the largest clique IMO. For example,
If I want to find the largest clique containing A, and I do this by greedy search, I may end up finding (A,B), which is smaller than another clique (A,C,D).
I came up with a naive way to avoid smaller cliques: First find all vertices that are adjacent to your starting point, and then for each of these vertices (let's call it x), calculate how many other vertices that x is not adjacent to. After this, delete the vertex that is not adjacent to most number of vertices, and check if the rest of them form a clique. If not, repeat the procedure until the rest of them form a clique.
I understand this is a silly question but I'd appreciate it very much if anyone can tell me whether this approach is correct or not.
Enumerate all maximal cliques within your graph, then just check - do they contain given vertex or do not.
Maximal clique enumeration is NP-hard problem, that is, we don't know an efficient way to solve it at the moment. I have tried MACE (MAximal Clique Enumerater, ver. 2.2 and it worked quite well for me (it worked on graphs with thousands of vertices). You can check the details in corresponding article.
EDIT If you just want to check does the maximum clique contain a vertex or not, you can try cliquer to find the maximum clique.