1 / 34

A multiagent algorithm for graph partitioning

A multiagent algorithm for graph partitioning. Francesc Comellas & Emili Sapena Applied Mathematics Univertitat Politècnica de Catalunya Barcelona, Catalonia, Spain. Índex. 1. Introducció i Objectius 2. Teoria de grafs 3. Algorisme Formigues 4. Bipartició 5. K-partició 6. Clustering

Download Presentation

A multiagent algorithm for graph partitioning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A multiagent algorithm for graph partitioning Francesc Comellas & Emili Sapena Applied Mathematics Univertitat Politècnica de Catalunya Barcelona, Catalonia, Spain

  2. Índex • 1. Introducció i Objectius • 2. Teoria de grafs • 3. Algorisme Formigues • 4. Bipartició • 5. K-partició • 6. Clustering • 7. Conclusions • 8. Preguntes

  3. Tipus d’algorismes • Cerca exhaustiva • Cerca local o aleatòria • Algorismes heurístics • Algorismes naturals

  4. Cerca exhaustiva • Els algorismes de cerca exhaustiva són aquells que calculen totes les solucions possibles al problema per quedar-se amb la millor. • Sempre troben la millor solució • El cost de l’execució augmenta amb el nombre de solucions possibles.

  5. Cerca local o aleatòria • Es basen en una exploració reduïda i a l'atzar de l'espai d'estats. • Són més ràpids que els exhaustius.  No garanteixen trobar la millor solució, ni tan sols una subòptima.

  6. Algorismes heurístics • Específics per resoldre un tipus de problema • Troba solucions òptimes o subòptimes en temps molt menors a la cerca exhaustiva. • Cal un estudi previ del problema molt rigorós i, moltes vegades, una idea brillant. • Solen ser poc adaptables a d’altres problemes.

  7. Algorismes naturals • Es basen en la imitació de mecanismes de la natura per a la resolució de determinats problemes. • Fàcilment adaptables a diferents tipus de problemes. • Troben solucions òptimes o subòptimes en temps molt menors a la cerca exhaustiva

  8. Algorismes naturals • Xarxes neuronals • Algorismes genètics • Recuïta simulada (Simulated Annealing) • Algorisme multi-agent

  9. Algorisme Formigues • Algorisme multi-agent basat en la idea de que la cerca d’una millora local de cada agent per separat pot trobar una bona solució global. • Igual que en un formiguer, el treball coordinat individual i senzill de cada agent pot resoldre tasques molt complicades.

  10. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  11. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  12. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  13. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria Cost: 35

  14. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  15. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  16. ANTS algorithm • Random color the graph forming k balanced sets • Initialize the cost for each vertex • Initialize the global cost • Put N ants randomly on the graph • Do • Repeat (for each ant) • Move the ant to the worst* neighbor vertex • Change vertex color to the best possible* • Keep balance • Update cost for the vertex and its neighbors • Update global cost • Save partition if better • Until stop criteria

  17. ANTS algorithm • Generar acoloriment inicial aleatori del graf • Calcular el cost a cada vèrtex • Calcular el cost global • Posar N formigues aleatòriament al graf • Fer • Repetir (per a cada formiga) • Moure la formiga al pitjor* vèrtex veí • Canviar el color del vèrtex pel millor color possible* • Calcular cost/fitness del vèrtex i dels veïns afectats • Final repetir • Calcular cost global • Si hi ha millora, guarda l’acoloriment • Fins criteri d’aturada

  18. ANTS algorithm • Generar acoloriment inicial aleatori del graf • Calcular el cost a cada vèrtex • Calcular el cost global • Posar N formigues aleatòriament al graf • Fer • Repetir (per a cada formiga) • Moure la formiga al pitjor* vèrtex veí • Canviar el color del vèrtex pel millor color possible* • Calcular cost/fitness del vèrtex i dels veïns afectats • Final repetir • Calcular cost global • Si hi ha millora, guarda l’acoloriment • Fins criteri d’aturada

  19. ANTS algorithm • Generar acoloriment inicial aleatori del graf • Calcular el cost a cada vèrtex • Calcular el cost global • Posar N formigues aleatòriament al graf • Fer • Repetir (per a cada formiga) • Moure la formiga al pitjor* vèrtex veí • Canviar el color del vèrtex pel millor color possible* • Calcular cost/fitness del vèrtex i dels veïns afectats • Final repetir • Calcular cost global • Si hi ha millora, guarda l’acoloriment • Fins criteri d’aturada Cost: 33

  20. ANTS algorithm • Generar acoloriment inicial aleatori del graf • Calcular el cost a cada vèrtex • Calcular el cost global • Posar N formigues aleatòriament al graf • Fer • Repetir (per a cada formiga) • Moure la formiga al pitjor* vèrtex veí • Canviar el color del vèrtex pel millor color possible* • Calcular cost/fitness del vèrtex i dels veïns afectats • Final repetir • Calcular cost global • Si hi ha millora, guarda l’acoloriment • Fins criteri d’aturada Cost: 9

  21. ANTS algorithm • L’adaptació de l’algorisme Formigues a qualsevol problema en grafs es redueix a trobar una funció objectiva adequada. • Funció objectiva global • Funció objectiva local

  22. Probabilitat d’error • L’error és important per no caure en mínims locals.

  23. Índex • 1. Introducció i Objectius • 2. Teoria de grafs • 3. Algorisme Formigues • 4. Bipartició • 5. K-partició • 6. Clustering • 7. Conclusions • 8. Preguntes

  24. Bipartició • Consisteix en dividir un graf en dos parts complint les següents condicions: • Les dos parts han de tenir el mateix nombre de vèrtexs • El nombre de branques unint vèrtexs de diferents parts ha de ser el mínim possible

  25. Bipartició

  26. Bipartició • Utilitats: • Computació en paral·lel • Disseny VLSI • Data-mining

  27. Funció objectiva global • El nombre de branques que uneixen vèrtexs de diferents particions és directament el cost d’una solució • Com més petit sigui aquest nombre, millor serà la solució.

  28. Veïns del mateix color Fitness = Total veïns del vèrtex Funció objectiva local • Es defineix una fitness per determinar l’estat d’un vèrtex tenint en compte el seu acoloriment i el dels seus veïns.

  29. Funció objectiva local Veïns del mateix color = 3 = 0.6 Fitness = Total veïns del vèrtex = 5

  30. Resultats Graf GA SA EO Formigues ------------------------------------------------------------- U500.05 2 4 2 3 U500.10 26 26 26 26 U500.20 178 178 178 178 U500.40 412 412 412 412 U1000.05 1 3 1 3 U1000.10 39 39 39 43 U1000.20 222 222 222 228 U1000.40 737 737 737 737 G500.005 49 51 51 50 G500.01 218 219 218 218 G500.02 626 628 626 626 G500.04 1744 1744 1744 1744 G1000.0025 93 102 95 98 G1000.005 445 451 447 449 G1000.01 1362 1366 1362 1363 G1000.02 3382 3386 3383 3383 nasa1824 739 739 739 nasa2146 870 870 870 nasa4704 1292 1292 1334

  31. Índex • 1. Introducció i Objectius • 2. Teoria de grafs • 3. Algorisme Formigues • 4. Bipartició • 5. K-partició • 6. Clustering • 7. Conclusions • 8. Preguntes

  32. K-partició • Es tracta l’extensió del problema de la bipartició a k particions

More Related