Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithms and Networks

Similar presentations


Presentation on theme: "Algorithms and Networks"— Presentation transcript:

1 Algorithms and Networks
Johan M. M. van Rooij Hans L. Bodlaender

2 Teacher 1: Johan van Rooij
Teacher (only on Tuesday) Software Project. Algorithms and Networks. Master’s thesis projects. Consultant / Data Scientist (rest of the week) CQM B.V. Eindhoven. Contact me: BBG 5.07 (Tuesdays) Directly after the lecture Johan van Rooij

3 Teacher 2: Hans Bodlander
Professor in Utrecht Head of the algorithms group. Professor in Eindhoven In Eindhoven on Mondays. Contact me: BBG 5.03 (Thursday 15-17) Or, see if I’ve time. Or, make an appointment by . Hans Bodlaender

4 What are we going to do today?
Part 1: Algorithms and Networks: what and why? Course organisation. Euler tour example. Part 2: Lecture: stable marriage problem.

5 Algorithms and Networks
What and why?

6 Graphs Started in 1736 with paper by Euler: bridges of Königsberg. Can we make a walk where we cross each bridge once (Euler-tour)? Voorbeeld is uit het paper waarin dit werk uit 1736 (pas veel later) in is opgeschreven. Deze graaf is niet de graaf van königsberg. A B C D E F

7 Networks Graphs are a (mathematical) model for many things in the real world: Road networks, electrical networks, computer networks, organizational diagrams, social networks, structure of software, data base diagrams, … Often real world problems have additional information. Then, the network is graph with some extra information such as: Weights, lengths, distances, costs, time, … Labels, sizes, names, …

8 Graph/network problems
Often, we want to compute something on the network, motivated from the application (or theoretical curiosity). Examples: Shortest path from A to B. Maximum flow from A to B. Does the graph have an Euler tour (all edges exactly once). Does the graph have a Hamiltonian cycle (all nodes exactly once). How good and fast can we let the computer do this computation? Theoretical questions of algorithm design. If fast algorithms exists, of high practical value.

9 Model and algorithm Real-world problem.
Mathematical model of real-world problem. Algorithm for mathematical model. Solution produced by the algorithm. Translation of solution to solution for real-world problem. Check that the translated solution makes sense for the real-world problem. If you do this for real problems for real customers, step 6 is often followed by designing a better model and returning to step 2. This course is focusses on steps 3: algorithms. But expects and practices also a little bit of step 2: modelling.

10 Algorithms and complexity
Exact, heuristic, approximation, special cases, … Polynomial time, exponential time, … Polynomial space, exponential space, … Algorithms that parallelize well, or not, … Complexity (asymptotic – O-notation) Intrinsic difficulty of a problem. NP-completeness, other complexity classes. Approximation complexity (e.g. APX-completeness) Fixed parameter tractability.

11 Algorithmic techniques
Combinatorial algorithms. Mathematical programming. (Integer) linear programming. Quadratic programming. Non-linear programming. Pruning an exhaustive search tree. Branch and bound. Constraint programming. Heuristics. Greedy heuristics Local search (iterative improvement, simulated annealing, tabu search, evolutionary algorithms, …)

12 Polynomial solution algorithms
Solution quality Computation time Optimal Bound on quality Good solution, no quality guarantee Polynomial Polynomial solution algorithms Approximation algorithms Construction heuristics Super polynomial and/or no guarantee Exact algorithms: Tree search Dynamic programming Integer linear programming …… Hybrid algorithms Column generation without complete branch-and-price Meta heuristics: Local search Genetic algorithms I borrowed this slide from Marjan van den Akker.

13 Polynomial solution algorithms
Solution quality Computation time Optimal Bound on quality Good solution, no quality guarantee Polynomial Polynomial solution algorithms Approximation algorithms Construction heuristics Super polynomial and/or no guarantee Exact algorithms: Tree search Dynamic programming Integer linear programming Hybrid algorithms Column generation without complete branch-and-price Meta heuristics: Local search Genetic algorithms P I hope you know what P and NP are, and what this means? NP-hard

14 Polynomial solution algorithms
Solution quality Computation time Optimal Bound on quality Good solution, no quality guarantee Polynomial Polynomial solution algorithms Approximation algorithms Construction heuristics Super polynomial and/or no guarantee Exact algorithms: Tree search Dynamic programming Integer linear programming …… Hybrid algorithms Column generation without complete branch-and-price Meta heuristics: Local search Genetic algorithms Algorithms and networks Explore the fundamentals of what can algorithmically be done on hard problems. Focus on what can be done while still obtaining optimal solution quality. Algorithms and networks

15 Algorithms and Networks
Course ORGANISATION

16 Algorithms and networks
2 lectures per week. Tuesday 9:00 – 10:45 by Johan van Rooij. Thursday 13:15 – 15:00 by Hans Bodlaender. Approximately 8 sets of exercises. Two weeks time for handing them in. 2 partial exams. See the course website ( for Important updates on the course. Slides. Exercises. Schedules. Grades. Etc.

17 Purpose of course Knowing and being able to use and apply…
Important algorithmic techniques and research fields. Important algorithms and their applications. Analysis of algorithms. The mathematics behind these concepts. A little bit of algorithmic modelling. In particular for combinatorial problems involving graphs and networks.

18 Topics of course (1) Important polynomial-time algorithms.
Stable marriage. Shortest paths. Maximum flow. Minimum cost flow. Matching (bipartite, general graphs). Dealing with hard problems, …

19 Topics of course (2) Important polynomial-time algorithms, …
Dealing with hard problems problems, Exact expontial-time algorithms. Approximation algorithms and complexity. Parameterized algorthms and complexity. Kernelisation. Treewidth. Hard problems on resticted graph classes, e.g., planar graphs. Graph Isomorphism.

20 Final grade Final Grade = (Exercise set average) * 0.3
+ (Exam 1) * 0.35 + (Exam 2) * 0.35 Assuming: Exercise sets at least 6.0. Average exams at least 5.0. Details see webpage.

21 Studying this course Visit the lectures!
Materials are scattered through literature: often hard to study at home if you were not at the course. Make notes! If you are not at the course: borrow/copy notes of other students. Next to the lectures, you learn the most from the exercises. Finish them before the corresponding exam, even when the deadline is later. Topics in exercises that are not in the lectures are exam content! Some books are recommended, but not necessary. Use the powerpoints and pdf’s on the website.

22 Graded exercise sets 8 sets (maybe 7 or 9) Hand in: Dutch or English
You have two weeks for each set. Every week a new exercise set will be handed out. Hand in: By include [AN1], [AN2] etc in the header of your . Or, on paper during the lectures. Or, on paper in Hans’ mailbox on the 5th floor of the BBG. Deadline: Monday 23:59 hours. After the deadline: grade = 0 (exception: joker rule) Dutch or English Write clear, legible, etc. Unreadable, messy: grade = 0

23 On the exercise sets Lots of work..., but you learn a lot...
Working in pairs: OBLIGATORY, due to this years high number of students. Both should have worked on and have understood all parts of what is handed in. Allowed to mark parts as been done by one student. Joker rule (write joker on your work or in your ): Twice during the course you can extend your deadline with three days (Monday 23:59 becomes Thursday 23:59). Miss a third deadline: grade = 0. Unless there are very special circumstances for all missed deadlines.

24 Workload This course is 7.5 ETCS. Each week:
This means 20 hour of work per week (officially). Each week: Two lectures on two different topics. Making exercises – lots of work, but not that much. Studying topics covered by the lectures yourself. We go through a lot of material, so we recommend to study the material during the course, not only for the exams.

25 Are there ... Any questions on the organisation of the course?

26 Algorithms and Networks
Euler tour example

27 Let’s get back to our example
Can we make a walk where we cross each bridge once? Yes! Can we make a round tour where we cross each bridge once? No! Why? (next slide) A B C D E F

28 Why? A B C D E F Can we make a walk where we cross each bridge once?
Yes: D-E-A-D-C-A-C-F-A-F-B-F-E-B-A-E. Can we make a round tour where we cross each bridge once? (Eurler tour). No. Why? Theorem: A connected graph has an Euler tour, if and only if, every vertex in the graph has even degree. If: round trip through an odd degree vertex not possible. Only if...

29 If... proof continued Lemma: If every vertex in a connected graph has even degree, then it has an Euler tour that can be found using the following algorithm: From any starting vertex v build up any tour using unvisited edges until returning to v. It is not possible to get stuck because all vertices have even degree before and after the tour visits the vertex. Hence the tour can only enter vertices of degree at least 2. While there exists unvisited edges, select a vertex u on the tour with unvisited edges. Start another trail from u, following unused edges until returning to u, merge the two tours and return to step 2. Again we cannot get stuck because of the same reason.

30 Euler paths and tours A B C D E F
Theorem: A connected graph has an Euler tour, if and only if, every vertex in the graph has even degree. Corollary: A connected graph has an Euler path, if and only if, the graph has 0 or 2 vertices of odd degree. So we can see directly that our example graph has an Euler path. Even without the given solution. D-E-A-D-C-A-C-F-A-F-B-F-E-B-A-E A B C D E F

31 Algorithms and Networks
Time for a break...


Download ppt "Algorithms and Networks"

Similar presentations


Ads by Google