Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Graph theory and software engineering it1

Milda
March 06, 2020
78

Graph theory and software engineering it1

Milda

March 06, 2020
Tweet

Transcript

  1. PART 1: Basics a.k.a stuff I should have learned in

    the university but I wasn’t listening
  2. ORIGINS • There should not be any uncrossed bridges •

    Each bridge must not be crossed more than once.
  3. ORIGINS • There should not be any uncrossed bridges •

    Each bridge must not be crossed more than once.
  4. ORIGINS • 4 lands, 7 bridges • There are an

    odd number of bridges connected to each land • if you enter a land by crossing one bridge, you can always leave the land by crossing its second bridge. If third bridge appears, you won’t be able to leave a land.
  5. ORIGINS An Euler path of a finite undirected graph G(V,

    E) is a path such that every edge of G appears on it once. If G has an Euler path, then it is called an Euler graph.
  6. ORIGINS Theorem. A finite undirected connected graph is an Euler

    graph if and only if exactly two vertices are of odd degree or all vertices are of even degree. In the latter case, every Euler path of the graph is a circuit, and in the former case, none is.
  7. Dijkstra’s algorithm 1) Mark all nodes unvisited. Create a set

    of all the unvisited nodes called the unvisited set. 2) Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all other nodes. Set the initial node as current. Graph algorithms
  8. Dijkstra’s algorithm 1) Mark all nodes unvisited. Create a set

    of all the unvisited nodes called the unvisited set. 2) Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all other nodes. Set the initial node as current. Graph algorithms
  9. Dijkstra’s algorithm 3) For the current node, consider all of

    its unvisited neighbors and calculate their tentative distances through the current node. Compare the newly calculated tentative distance to the current assigned value and assign the smaller one. Graph algorithms
  10. Dijkstra’s algorithm 4) When we are done considering all of

    the neighbors of the current node, mark the current node as visited and remove it from the unvisited set. A visited node will never be checked again. Graph algorithms
  11. Dijkstra’s algorithm 5) If the destination node has been marked

    visited (when planning a route between two specific nodes) or if the smallest tentative distance among the nodes in the unvisited set is infinity (when planning a complete traversal; occurs when there is no connection between the initial node and remaining unvisited nodes), then stop. The algorithm has finished. 6) Otherwise, select the unvisited node that is marked with the smallest tentative distance, set it as the new “current node”, and go back to step 3. Graph algorithms
  12. Dijkstra’s algorithm 5) If the destination node has been marked

    visited (when planning a route between two specific nodes) or if the smallest tentative distance among the nodes in the unvisited set is infinity (when planning a complete traversal; occurs when there is no connection between the initial node and remaining unvisited nodes), then stop. The algorithm has finished. 6) Otherwise, select the unvisited node that is marked with the smallest tentative distance, set it as the new “current node”, and go back to step 3. Graph algorithms
  13. PART 2: Graphs are fun a.k.a stuff I found interesting

    but did not know how to structure into proper presentation
  14. GT in Model based testing Model based testing is a

    software testing technique where run time behavior of software under test is checked against predictions made by a model. A model is a description of a system's behavior.
  15. MBT ▪ You create model of a SUT ▪ It’s

    a simplified model ▪ It’s a state model defining states and relationships between them ▪ From this model you can generate tests and execute them on SUT
  16. GT in MBT ▪ Chinese postman problem solutions ▪ de

    Bruijn sequences algorithm ▪ Random Walk algorithm
  17. Graph coloring problem Given m colors, find a way of

    coloring the vertices of a graph such that no two adjacent vertices are colored using same color.
  18. In compiler optimization, register allocation is the process of assigning

    a large number of target program variables onto a small number of CPU registers.
  19. Nodes in the graph represent live ranges (variables, temporaries, virtual/symbolic

    registers) that are candidates for register allocation. Edges connect live ranges that interfere , i.e., live ranges that are simultaneously live at at least one program point. Register allocation then reduces to the graph coloring problem in which colors (registers) are assigned to the nodes such that two nodes connected by an edge do not receive the same color.
  20. GT in OO programs ▪ Identification of “God” classes -

    HyperLink Induced Topic Search algorithm
  21. Hyperlink-Induced Topic Search is a link analysis algorithm that rates

    Web pages. The scheme assigns two scores for each page: its authority, which estimates the value of the content of the page, and its hub value, which estimates the value of its links to other pages.
  22. GT in OO programs ▪ Identification of “God” classes -

    HyperLink Induced Topic Search algorithm ▪ Design pattern detection - graph matching algorithms