### Indice

# Year 2017-2018

### Announcements

Please register at http://piazza.com/unipi.it/fall2017/642aa for electronic discussion and other activities.

### Schedule

- Regarding your exam planning: I'll be on leave during 19.09.18-15.10.18 and 01.11.2018-28.02.19.
- Timetable: weekly timetable with changes: (Oct.5 → Oct.4, 14-16, I-Lab); (Oct.9 → Oct.2, 14-16, room A1); (Oct.10 → Oct.23, 14-16, room A1).
- Office hours: Thu. 14-17 or by appointment.

### Overview

The advanced nature of this course focuses on developing algorithmic design skills, exposing the students to complex problems that cannot be directly handled by standard libraries (being aware that several basic algorithms and data structures are already covered by the libraries of modern programming languages), thus requiring a significant effort in problem solving. These problems involve all basic data types, such as integers, strings, (geometric) points, trees and graphs as a starting point. The syllabus is structured to highlight the applicative situations in which the corresponding algorithms can be successfully employed, making references to software applications and libraries. The level of detail in each argument can change year-by-year, and will be decided according to requests coming from other courses in the curriculum and/or specific issues arising in, possibly novel, applicative scenarios.

### Exams

*Written exam:*

- choose one of the topics discussed in class
- write a very short to-do list and ask the instructor for approval
- if the instructor suggests some mods, modify the to-do list according to the instructor's comments and repeat step 2
- if the chosen topic and the to-do list are approved, expand the to-do list into a more detailed to-do list and repeat step 3
- make a written report in English and submit it to the instructor (recall to add at least 20% new content, when compared to what seen in class)
- meet the instructor to read together the report and get some comments on it
- make the necessary mods

Suggested reading: some useful tips for scientific writing in English (first two sections) by J.S. Vitter.

Example of interaction: student and instructor discussing the report's content and structure.

*Oral exam:* topics discussed in class, please read the references in the notes.

### Topics

Caveat: Several topics are the outcome of recent advancements in the field, and thus the course material mostly consists in research papers or book chapters.

#### Glimpse on the class topics

Date | Topics | References and notes |
---|---|---|

18.09.2017 | Distributed server and load balancing through hashing. | blog |

19.09.2017 | Download file manager and the knapsack problem: hardness, approximation and heuristics. | snapshot |

21.09.2017 | Large-scale analysis of social networks through diameter computation. | snapshot |

#### Randomization, hashing and data streaming

Randomization is a powerful tool to solve large-scale problems. After introducing the concept of randomized algorithms and hashing, we consider some applications, such as data streaming algorithms, a field emerged in the last decade. Here data flow as a stream and one-pass algorithms with limited memory can process it. We focus on the count-min sketch paradigm and its applications. [Note: to refresh the basic notions on counting and probability, please refer to Appendix C in Cormen-Leiserson-Rivest-Stein's book “Introduction to Algorithms”, 3rd ed., MIT Press.]

Date | Topics | References and notes |
---|---|---|

25.09.2017 | Playing with probability. Random indicator variables: secretary problem and random permuting (suggested reading: birthday paradox). Randomized quick sort. | [CLRS 5.1-5.3 (optional 5.4.1), par. 7.3] code |

26.09.2017 | Virus scan and stream analysis with Karp-Rabin fingerprints: randomized checking and pattern matching. Montecarlo and Las Vegas algorithms. | [RM par.7.4-7.6] code |

28.09.2017 | Dictionary of keywords. Quick review of classical hashing. Universal hashing. Markov's inequality. Perfect hashing. | [CLRS 11.2, 11.3.3, CLRS 11.5 ] code |

02.10.2017 | Case study on hashing: rsync and file synchronization using hash functions | slides wikipedia |

02.10.2017 | Data Streaming algorithms. Motivations and examples. Count-Min Sketches | sects.1-3 Site Notes code |

03.10.2017 | Queries with Count-Min Sketches: implementation and analysis. | sects.3-4 Notes Notes (optional) |

04.10.2017 | Document resemblance with MinHash, k-sketches and the Jaccard similarity index. Azuma-Hoeffding bound. | paper paper Azuma-Hoeffding code |

19.10.2017 | Case study on hashing: document tagging and perfect hashing. | code |

23.10.2017 | Networked data and randomized min-cut algorithm for graphs. | par.1.1 |

23.10.2017 | Proxy caches and dictionaries with errors: Bloom filters. | Survey: except par.2.5-2.6 (optional: par.2.2) |

24.10.2017 | Randomness in data. Kolmogorov complexity. Generating random sequences and permutations (exercise: subsets). | Notes Sect. 5.4 |

26.10.2017 | Generating random trees. Models for generating random graphs: Erdős-Rényi-Gilbert G(n,p), Barabási–Albert preferential attachment, Watts–Strogatz small world, configuration model. | Sect. 5.5 Sect. 1.1-1.3 (optional 1.5-1.6), 4,1 (till pag.126), 7.1-7.2, 8.1 |

06.11.2017 | Case study on data stream: statistics and analytics (part 1). | notes |

07.11.2017 | Distributed server and load balancing through hashing: revisited | Sect.7 and 8.1 |

09.11.2017 | The power of two random choices: Cuckoo hashing. | Notes Notes code |

13.11.2017 | Case study on data stream: statistics and analytics (part 2). | notes code |

#### Enumeration, hardness and approximation of some combinatorial problems

NP-hard problems are important but difficult to solve and no deterministic polynomial algorithms are currently known for them. Even basic problems, such as finding a simple path of vertices in a graph, are NP-hard. We discuss how to attack these problems (a) by counting and listing their solutions where the cost is proportional to the output (it can be exponential in the worst case but we only pay for what we get) and (b) by approximating their solutions with polynomial-time algorithms when the problem requires to minimize a cost or maximize a benefit. Most of the addressed problems are on graphs, which are popular representations for modern networked data.

Date | Topics | References and notes |
---|---|---|

12.10.2017 | Introduction to the P vs NP problem. Polynomial reducibility among problems. | [CLRS, Chapt.34 till first part of Sect.34.3] |

16.10.2017 | NP-complete problems. Cook-Levin Theorem: an intuition. Reduction examples: from 3SAT to Clique (substitution); from 3SAT to vertex cover VC (gadget). | [CLRS, Sect. 34.3, Th. 34.11 and 34.12, Sect. 34.5.2] Cook-Levin |

17.10.2017 | NP-hard problems. Reduction from Partition to Knapsack (restriction). Dynamic programming algorithms for Knapsack: Case 1: integer weights, complexity O(nW). Case 2: integer values, complexity O(n^{2}vmax). Examples. | PDF code |

14.11.2017 | NP-hard problems: heuristics based on dynamic programming; approximation algorithms. Case study: knapsack problem. | chapt.2: par. 2.1.1 code |

16.11.2017 | NP-hard problems: branch and bound algorithms; fully polynomial-time approximation schemes (FPTASs). Case study: knapsack problem. | ch.8 notes code |

20.11.2017 | Case study on bottom-k sketches: approximate similarity searching of large collections of images | paper |

21.11.2017 | NP-hard problems: counting version (#P) based on dynamic programming, uniform random sampling of the feasible solutions; fully polynomial-time randomized approximation schemes (FPRASs). Case study: #knapsack problem. | notes code |

23.11.2017 | General inapproximability results. Case study: travel salesman problem (TSP). 2-approximation algorithm . | [CLRS 35.2] |

27.11.2017 | Case study on approximation for metric k-center: Clustering and video summarization. | slides notes |

28.11.2017 | Non-existence of PTAS. Local search. Greedy. Case study: max cut for graphs. | Notes |

30.11.2017 | Randomized approximation. Derandomization: universal hash functions; conditional expectations. Case study: max-cut for graphs. | sect. 3-4 sect. 1.1 |

04.12.2017 | Case study on approximation for graphs (max cut): single individual haplotypes reconstruction problem (hapcut) | paper |

05.12.2017 | Fixed-parameter tractable (FPT) algorithms. Kernelization. Bounded search tree. Case study: min-vertex cover in graphs. | sect. 2.2.1, 3.1 |

07.12.2017 | Randomized FPT algorithms: color coding and randomized separation. Case study: longest path in graphs and subgraph isomorphism. | sect. 5.2, 5.3 |

11.12.2017 | Class canceled for weather alert. | - |

12.12.2017 | Fine-grained algorithms. SETH conjecture and conditional lower bounds. Guaranteed heuristics. Case study: diameter in undirected unweighted graphs. | notes sect. 2.3, 2.4, 3, 4 |

14.12.2017 | Approximation in fine-grained algorithms and limitations. Case study: diameter in undirected unweighted graphs. Case study: communities detection in large graphs. | notes paper supplement |

##### Activity in class

- Some of the screen snapshots shown during the classes.

##### Official documents for the course

- Access to unimap log (registro delle lezioni).
- Access to the course evaluation form (questionario studenti).