finding all cliques

Upload: mouhabalde

Post on 14-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Finding All Cliques

    1/31

    Finding All Cliques of an Undirected Graph

    Seminar Current Trends in IE WS 06/07

    Michaela Regneri

    11.01.2007

    1

  • 7/27/2019 Finding All Cliques

    2/31

    Motivation

    How to put as much left-over stuff as possible in a tastymeal before everything will go off?

    Finding CliquesMichaela Regneri 2

  • 7/27/2019 Finding All Cliques

    3/31

    Motivation

    Find the largest collection of food where everything goestogether! Here, we have the choice:

    Finding CliquesMichaela Regneri 3

  • 7/27/2019 Finding All Cliques

    4/31

    Motivation

    Find the largest collection of food where everything goestogether! Here, we have the choice:

    Finding CliquesMichaela Regneri 4

  • 7/27/2019 Finding All Cliques

    5/31

    Motivation

    Find the largest collection of food where everything goestogether! Here, we have the choice:

    Finding CliquesMichaela Regneri 5

  • 7/27/2019 Finding All Cliques

    6/31

    Motivation

    Find the largest collection of food where everything goestogether! Here, we have the choice:

    Finding CliquesMichaela Regneri 6

  • 7/27/2019 Finding All Cliques

    7/31

    Outline

    Introduction to cliques

    The Bron-Kerbosch algorithm

    Applications

    Conclusion

    Finding CliquesMichaela Regneri 7

  • 7/27/2019 Finding All Cliques

    8/31

    Outline

    Introduction to cliques

    The Bron-Kerbosch algorithm

    Applications

    Conclusion

    Finding CliquesMichaela Regneri 8

  • 7/27/2019 Finding All Cliques

    9/31

    Cliques (according to Bron and Kerbosch 1973)

    complete subgraph of a graph: part of a graph in which all

    nodes are connected to each other

    cliques: maximal complete subgraphs (not subsumed by any

    other complete subgraph)

    9Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    10/31

    A graph

    How many cliques?

    Finding CliquesMichaela Regneri 10

  • 7/27/2019 Finding All Cliques

    11/31

    The cliques

    How can we find them efficiently?Finding CliquesMichaela Regneri 11

  • 7/27/2019 Finding All Cliques

    12/31

    Outline

    Introduction to cliques

    The Bron-Kerbosch algorithm

    Applications

    Conclusion

    Finding CliquesMichaela Regneri 12

  • 7/27/2019 Finding All Cliques

    13/31

    The Bron-Kerbosch algorithm

    finding all cliques is expensive

    the number of cliques can grow exponentially with every

    node added

    Bron and Kerbosch (1973):

    An algorithm to compute all cliques in linear time (relative

    to the number of cliques)

    still widely used and referred to as one of the fastestalgorithms (cf. Stix 2004)

    Finding CliquesMichaela Regneri 13

  • 7/27/2019 Finding All Cliques

    14/31

    Different sets and types of nodes

    the nodes already defined as part of the clique (compsub)(initially empty)

    the candidates, connected with all nodes ofcompsub

    not, the nodes already processed which lead to a validextensions for compsub and which shouldnt be touched

    a selected candidate

    nodes which are not considered in the current step

    C

    S

    Finding CliquesMichaela Regneri 14

  • 7/27/2019 Finding All Cliques

    15/31

    A clique is found if (and only if)...

    there are no candidatesanymore AND

    there are no nodes innot(otherwise, the

    recent clique is not

    maximal!)

    15Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    16/31

    The recursive procedure

    let the notset consist ofone node

    (the extension leading to

    the clique seen before)

    three nodes in compsub(known part of theclique)

    two candidates left

    Finding CliquesMichaela Regneri 16

    C C

  • 7/27/2019 Finding All Cliques

    17/31

    The recursive procedure

    1. select a candidate

    Finding CliquesMichaela Regneri 17

    CS

  • 7/27/2019 Finding All Cliques

    18/31

    The recursive procedure

    1. select a candidate

    2. add it to compsub

    Finding CliquesMichaela Regneri 18

    CS

  • 7/27/2019 Finding All Cliques

    19/31

    The recursive procedure

    1. select a candidate

    2. add it to compsub

    3. compute newcandidates and not set

    for the next recursion

    step (but store the old

    sets) by removing the

    nodes not connected tothe selected candidate

    4. start at 1 with the new

    setsFinding CliquesMichaela Regneri 19

    C

  • 7/27/2019 Finding All Cliques

    20/31

    The recursive procedure

    5. back from recursion,

    restore the old sets and

    add the candidate

    selected before to not

    Finding CliquesMichaela Regneri 20

    C

  • 7/27/2019 Finding All Cliques

    21/31

    Termination conditions

    1. no candidates left or

    2. there is an element in

    notwhich is connectedto every candidate left

    (if 2 holds, the additionof a candidate cannot

    lead to a clique which ismaximal, because the

    node in notwould be

    missing)

    Finding CliquesMichaela Regneri 21

    C

  • 7/27/2019 Finding All Cliques

    22/31

    Optimizing candidate selection

    terminate as early as possible (minimize number ofrecursion steps)

    aiming at having a node in notconnected to all candidates

    the trick:

    nodes in notget a counter indicating to how manycandidates they are not connected

    pick the node in notwith the fewest disconnections

    in each step, pick a new candidate disconnected to thisnode

    Finding CliquesMichaela Regneri 22

  • 7/27/2019 Finding All Cliques

    23/31

    Outline

    Introduction to cliques

    The Bron-Kerbosch algorithm

    Applications

    Conclusion

    Finding CliquesMichaela Regneri 23

  • 7/27/2019 Finding All Cliques

    24/31

    Solving the maximum independent set

    problem

    maximum independent set of a graph: the largest set of

    nodes which are all connected to each other

    a famous application of this: compute the trunk capacity of

    a car

    the question here: how many blocks (of a fixed volume) fit

    in the trunk?

    24Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    25/31

    Solving the maximum independent set

    problem (cont.)

    nodes represent a brick and its coordinates

    an edge between two nodes means that the two bricks

    overlap

    5|1|3

    2|1|0

    11|0|5

    7|4|2

    9|0|3

    4|4|3

    2|10|4

    25Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    26/31

    Solving the maximum independent set

    problem (cont.)

    the idea: bricks can be placed in the trunk at certain

    coordinates at the same time, if the corresponding nodesare not connected in the graph

    if we invert the edges, an edge means not connected

    5|1|3

    2|1|0

    11|0|5

    7|4|2

    9|0|3

    4|4|3

    2|10|4

    26Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    27/31

    Solving the maximum independent set

    problem (cont.)

    now we only have to check the cliques and find the largest

    one(s)

    the number of nodes is the maximal number of blocks fitting

    5|1|3

    2|1|0

    11|0|5

    7|4|2

    9|0|3

    4|4|3

    2|10|4

    27Finding CliquesMichaela Regneri

  • 7/27/2019 Finding All Cliques

    28/31

    Finding different word senses?

    ...inspired by Widdowsand Dorow (2002)

    Finding CliquesMichaela Regneri 28

  • 7/27/2019 Finding All Cliques

    29/31

    Other Applications

    several applications in bioinformatics and drug design

    (similarity of proteins or chemical formulas in general)

    McDonald et al. (2005) next talk

    Finding CliquesMichaela Regneri 29

  • 7/27/2019 Finding All Cliques

    30/31

    Conclusion

    problem: finding all cliques of a graph efficiently

    hard task (in terms of memory and runtime)

    Bron-Kerbosch algorithm is one efficient solution

    several applications - perhaps some more could be invented

    (operating on ontologies e.g.)

    Finding CliquesMichaela Regneri 30

  • 7/27/2019 Finding All Cliques

    31/31

    Literature

    Coen Bron and Joep Kerbosch (1973): Algorithm 457: Finding All Cliquesof an Undirected Graph. Communications of the ACM Vol. 16, Issue 9.ACM Press: New York, USA.

    Dominic Widdows and Beate Dorow (2002): A graph model for

    unsupervised lexical acquisition. Proceedings of the 19th internationalconference on Computational linguistics. ACL: Morristown, USA.

    Volker Stix (2004): Finding All Maximal Cliques in Dynamic Graphs.Computational Optimization and Applications Vol. 7, Issue 2.Kluwer Academic Publishers: Norwell, USA.

    Finding CliquesMichaela Regneri 31