ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

Μέγεθος: px
Εμφάνιση ξεκινά από τη σελίδα:

Download "ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ"

Transcript

1 ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ AΛΓΟΡΙΘΜΟΙ ΓΡΑΦΩΝ ΙΙΙ Minimum Spanning Trees ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 1

2 Trees Ένας γράφος T = (V, A) είναι δέντρο ΑΝ ΚΑΙ ΜΟΝΟ ΑΝ: is acyclic and connected is connected and has V - 1 edges is acyclic and has V - 1 edges is minimally connected: removal of any edge disconnects it is maimally acyclic: addition of any edge creates a cycle has a unique simple path between every pair of vertices T = (V, A) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs

3 Spanning Trees ΕΙΣΟΔΟΣ: Γράφος G=(V, E) ΕΡΩΤΗΣΗ: Ένα δέντρο T = (V, Ε ), Ε Ε G = (V, E) T = (V, E ) Συνδέει όλους τους κόμβους του γράφου με τις ελάχιστες ακμές Αλγόριθμος? ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 3

4 Minimum Spanning Tree (MST) ΕΙΣΟΔΟΣ: Γράφος με βάρη G=(V, E), w(e), e E ΕΡΩΤΗΣΗ: Ένα δέντρο T = (V, Ε ), Ε Ε με το ελάχιστο άθροισμα βαρών των ακμών του G = (V, E) T = (V, Ε ) w(t) = 50 Αλγόριθμος? Brute force? There are n n- spanning trees of K n [Cayley, 1889] ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 4

5 Τομή Γράφου (Graph Cut) Γράφος G=(V,E) ΤΟΜΗ C=(S, V-S), S V : διαμέριση (partition) των κόμβων του G σε δύο υποσύνολα S και V-S C = {(u,v) u S, v V-S}, S V : το υποσύνολο των ακμών με ένα άκρο στο S και ένα στο V-S S S = {4, 5, 8} C = { (5, 6), (5, 7), (3, 4), (3, 5), (7, 8) } 7 8 ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 5

6 Ιδιότητα τομής (Cut property) Έστω: - Χ ένα υποσύνολο των ακμών ενός MST - C μια τομή του G που δεν περιέχει ακμές από το Χ - e η μικρότερου βάρους ακμή της τομής C Τότε: οι ακμές Χ U {e} ανήκουν σε ένα MST (η ακμή e ανήκει στο ίδιο MST με τις Χ ) Χ Χ ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 6

7 Proof of Cut Property Oι ακμές Χ ανήκουν σε ένα MST, έστω Τ Έστω ότι e T Κάποια άλλη ακμή e C ανήκει στο Τ w(e ) w(e) Αντικατέστησε την e με την e στο Τ Το T = T U {e} {e } είναι δέντρο (γιατί?) W(T )=W(T) + w(e) w(e ) W(T) ATOΠΟ, γιατί το T είναι MST ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 7

8 A generic MST algorithm Η ιδιότητα τομής εγγυάται την ορθότητα κάθε αλγορίθμου σαν τον παρακάτω: X = { } \\ edges selected so far While X < V - 1: Choose S V: X has no edges between S and V-S Find the lightest edge e between S and V-S X = X U {e} ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 8

9 Prim's MST algorithm Εφάρμοσε την ιδιότητα τομής για την τομή S, V-S, όπου S είναι ΕΝΑ ΥΠΟ-ΔΕΝΤΡΟ ενός MST (X είναι το σύνολο των ακμών αυτού του υπό-δέντρου) Ξεκίνα από οποιοδήποτε κόμβο Σε κάθε βήμα προστίθεται στο MST ένας κόμβος και μία ακμή Επαναληπτικά: Διάλεξε τον κόμβο με την μικρότερη απόσταση από το τρέχον υπό-δέντρο (οποιοδήποτε κόμβο του) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 9

10 Prim's MST algorithm X = { } \\ edges selected so far S:={} \\ is any verte While X < V - 1: Find the lightest edge e=(u,v)between S and V-S \\ u S, v V-S S = S U {v} X = X U {e} Διάλεξε τον κόμβο με την μικρότερη απόσταση από το τρέχον υπό-δέντρο ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 10

11 Prim's MST algorithm - eample Διάλεξε τον κόμβο με την μικρότερη απόσταση από το τρέχον υπό-δέντρο Πώς υλοποιείται αποτελεσματικά? ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 11

12 Prim's MST algorithm π(u): συντομότερη του κόμβου u από το σύνολο S par(u): το MST PRIM(G,w) for all uv: π(u)=, par(u)=nil S={} π(s)=0 MAKE-HEAP (H,s) for all uv-{s}:insert(h,u) while NON EMPTY(H): DELETE-MIN (H,u) S = S U {u} for each vγ(u): if π(v) > w(u,v): π(v)= w(u,v) par(v)=u Greedy algorithm - Greedy choice: Διάλεξε τον κόμβο με τη μικρότερη απόσταση π(u) από το σύνολο S DECREASE-KEY(H,v,π(v) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 1

13 Dijkstra's algorithm π(u): συντομότερη απόσταση του κόμβου u από τον αρχικό κόμβο s par(u): τα συντομότερα μονοπάτια DIJKSTRA(G,s,w) for all uv: π(u)=, par(u)=nil S={} π(s)=0 MAKE-HEAP (H,s) for all uv-{s}:insert(h,u) while NON EMPTY(H): DELETE-MIN (H,u) S = S U {u} for each vγ(u): if π(v) > w(u,v)+ π(u): π(v)= w(u,v)+ π(u) par(v)=u Greedy algorithm - Greedy choice: Διάλεξε τον κόμβο με τη μικρότερη απόσταση π(u) από τον κόμβο s DECREASE-KEY(H,v,π(v)) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 13

14 Prim s and Dijkstra s algorithms: Compleity # of Operations Heap implementation Binary Binomial* Fibonacci* make-heap: 1 O(1) O(1) O(1) insert: n O(logn) O(1) O(1) delete-min: n O(logn) O(logn) O(logn) decrease-key: m O(logn) O(logn) O(1) Binary heap: 1 + n logn + n logn + m logn ~ O(m logn) Binomial heap: 1 + n + n logn + m logn ~ O(m logn) Fibonacci heap: 1 + n + n logn + m ~ O(m + n logn) * amortized ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 14

15 Kruskal's MST algorithm Έστω ένα υποσύνολο Χ των ακμών ενός MST του G e=(u,v) X T u and T v τα υπό-δέντρα του Τ στα οποία ανήκουν τα άκρα της e Υπάρχουν δύο περιπτώσεις: 1 η περίπτωση: Εάν T u T v, τότε αγνόησε την e (κύκλος) Case 1: e=(5, 8) 8 ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 15

16 Kruskal's MST algorithm Έστω ένα υποσύνολο Χ των ακμών ενός MST του G e=(u,v) X T u and T v τα υπό-δέντρα του Τ στα οποία ανήκουν τα άκρα της e Υπάρχουν δύο περιπτώσεις: η περίπτωση: Εάν T u T v ΚΑΙ η e είναι η μικρότερη στην τομή (T u,v- T u ), τότε X = X U {e} (η e ανήκει στο ΜST) Case : e=(5, 6) 8 ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 16

17 Kruskal's MST algorithm η περίπτωση: Εάν T u T v ΚΑΙ η e=(u,v) είναι η μικρότερη στην τομή (T u,v- T u ), τότε X = X U {e} (η e ανήκει στο ΜST) Αλγόριθμος: 5 4 Case : e=(5, 6) Επαναληπτικά (με αυτή τη σειρά ακμών): 8 3 Μπορούμε να εξετάσουμε τις ακμές με τέτοια σειρά ώστε η ακμή e να είναι η μικρότερη στην τομή (T u,v- T u )? ΝΑΙ: Αύξουσα σειρά βάρους w 1 w... w m Εάν η ακμή ΔΕΝ σχηματίζει κύκλο με τα τρέχοντα υπό-δεντρα του MST πρόσθεσέ την στο MST ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 17

18 Kruskal's MST algorithm Sort the edges s.t. w 1 w... w m \\ e i is the edge of weight w i X = { } \\ edges selected so far for i = 1 to m: if T u T v : X = X U {e i }; Πώς υλοποιείται αποτελεσματικά? ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 18

19 Union-Find A collection {S 1, S,..., S k } of DISJOINT dynamic sets : an element of some set S : the set which contains Operations MAKE-SET () Creates a new set S containing only element ; is not contained in any other eisting set UNION (,y) Unifies the disjoint sets containing elements and y (S and S y ) into a new set; Sets S and S y are destroyed FIND () Returns the set S (from a collection of disjoint sets) containing ; If, y S i, then FIND()=FIND(y) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 19

20 Kruskal's MST Algorithm Sort the edges s.t. w 1 w... w m \\ e i is the edge of weight w i X ={} \\ edges selected so far for each u V: make-set(u) for i = 1 to m: e i = (u,v) if find(u) find(v): union(u,v) X = X {e i } UNION-FIND make-set(u): creates a set containing element u union(u,v): unifies the disjoint sets containing elements u and v find(u): returns the set (from a collection of disjoint sets) containing element u SET = SUB-TREE ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 0

21 Kruskal's MST Algorithm Sort the edges s.t. w 1 w... w m \\ e i is the edge of weight w i X ={} \\ edges selected so far for each u V: make-set(u) for i = 1 to m: e i = (u,v) if find(u) find(v): union(u,v) X = X {e i } Compleity Sorting: O( E log E ) that is O( E log V ) - why? Union-Find: V make-set, E find, V -1 union each one of them costs O(log V ) (net slides) and altogether O( E log V ) In total: O( E log V ) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 1

22 Union-Find: Up-tree representation of sets Every set S i is represented by an up-tree The root of the tree is the representative of S i Every node has a pointer to its parent The root of the tree has a pointer to itself p[]: the parent of element e a d b c f g y h ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs

23 Union-Find: 1 st approach MAKE-SET() p[]= FIND() while <>p[]: =p[] return O(1) O(n) - why? UNION(,y) a=find() b=find(y) p[a]=b // or p[b]=a O(n) d e f O(n) time per operation a b c g h ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 3

24 Union-Find: 1 st approach UNION(,y) is not efficient A tree may become a chain O(n) time per operation Eample a + b b + c c... z a b Can we do better? a b ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 4 a

25 Union-Find: Union by Rank Make the root of the larger tree the parent of the root of the smaller tree... Union by rank R[]: the rank of element a measure of the size of the tree rooted at R[] is initiated to 0 by MAKE-SET R[] is updated only by UNION if R[a]=R[b] then R[new root]=r[b]+1 In this case R[] is the height of the tree rooted at ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 5

26 Union-Find: Union by Rank MAKE-SET () p[]= R[]=0 FIND () while <>p[]: =p[] return UNION (,y) d f a=find () b=find (y) a b c if R[a]>R[b]: p[b]=a else: p[a]=b if R[a]=R[b]: R[b]=R[b]+1 e g h ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 6

27 Union-Find: Union by Rank R[] = height of the tree rooted at MAKE-SET () O(1) FIND () O(R[]) UNION (,y) O(R[]) O(R[]) time per operation Now, the net lemma holds: Lemma: Let size() = # of nodes of S R[].Then, size() (see net slide for the proof) Obviously, n size() and by the lemma size() R[] Hence, n R[], that is R[] log n and therefore: O(log n) time per operation Can we do better? YES, much better!!! ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 7

28 Lemma: Let size() = # of nodes of S. Then, size() R[] Proof: By induction on # of UNIONs Basis (no UNION): R[]=0, size()=1 : 1 0 = 1 Hypothesis: The lemma holds before a UNION(,y) operation Inductive step: Three cases in UNION(,y) 1) R[]<R[y] : R[ ] = R[y] Union-Find: Union by Rank '] [ ] [ ] [ ] [ ) ( ) ( ') ( R y R y R R y size size size ) R[]>R[y]: R[ ] = R[] 3) R[]=R[y]: R[ ] = R[y]+1 '] [ ] [ ] [ ] [ ) ( ) ( ') ( R R y R R y size size size ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 8 '] [ 1 ] [ ] [ ] [ ] [ ) ( ) ( ) ' ( R y R y R y R R y size size size

29 Union-Find: Path compression FIND(): traces the path, a 1, a,..., a k, r from to the root r of S AND also makes all the parent pointers of, a 1, a,..., a k point to r directly r r FIND() Two-pass FIND() FIND () if <>p[]: p[]=find(p[]) return p[] ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 9

30 Union-Find: Path compression Theorem : If union by rank and path compression are used then the amortized compleity per operation is O(log*n) log*n = min{i0 : log (i) n 1} Iterated logarithm for n=1 (= 0 ) : log*n=1 for n= (= 1 ) : log*n=1 for n=3,4 (= ) : log*n= for n=5,6,,16 (= 4 ): log*n=3 for n=17,18,,65536 (= 16 ) : log*n=4 for n=65537,65538,, (= 64K ): log*n=5 for all practical purposes, log*n 5 ~ O(1) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ Ι. ΜΗΛΗΣ 14 - GRAPHS III - MSTs 30

Fractional Colorings and Zykov Products of graphs

Fractional Colorings and Zykov Products of graphs Fractional Colorings and Zykov Products of graphs Who? Nichole Schimanski When? July 27, 2011 Graphs A graph, G, consists of a vertex set, V (G), and an edge set, E(G). V (G) is any finite set E(G) is

Διαβάστε περισσότερα

Αλγόριθµοι και Πολυπλοκότητα

Αλγόριθµοι και Πολυπλοκότητα Αλγόριθµοι και Πολυπλοκότητα Ν. Μ. Μισυρλής Τµήµα Πληροφορικής και Τηλεπικοινωνιών, Πανεπιστήµιο Αθηνών Καθηγητής: Ν. Μ. Μισυρλής () Αλγόριθµοι και Πολυπλοκότητα Μαΐου 201 1 / Απληστοι (Greedy) Αλγόριθµοι

Διαβάστε περισσότερα

Network Algorithms and Complexity Παραλληλοποίηση του αλγορίθμου του Prim. Αικατερίνη Κούκιου

Network Algorithms and Complexity Παραλληλοποίηση του αλγορίθμου του Prim. Αικατερίνη Κούκιου Network Algorithms and Complexity Παραλληλοποίηση του αλγορίθμου του Prim Αικατερίνη Κούκιου Άδεια Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται σε άδειες χρήσης Creative Commons. Για εκπαιδευτικό υλικό,

Διαβάστε περισσότερα

Αλγόριθμοι και πολυπλοκότητα Minimum Spanning Trees

Αλγόριθμοι και πολυπλοκότητα Minimum Spanning Trees ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα Minimum Spanning Trees Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών Minimum Spanning Trees 204 86 BOS SFO 33 LAX 1464 1235 849 PVD ORD

Διαβάστε περισσότερα

Αλγόριθµοι και Πολυπλοκότητα

Αλγόριθµοι και Πολυπλοκότητα Αλγόριθµοι και Πολυπλοκότητα Ν. Μ. Μισυρλής Τµήµα Πληροφορικής και Τηλεπικοινωνιών, Πανεπιστήµιο Αθηνών Καθηγητής: Ν. Μ. Μισυρλής () Αλγόριθµοι και Πολυπλοκότητα 26 Ιουνίου 201 1 / Απληστοι (Greedy) Αλγόριθµοι

Διαβάστε περισσότερα

Minimum Spanning Tree: Prim's Algorithm

Minimum Spanning Tree: Prim's Algorithm Minimum Spanning Tree: Prim's Algorithm 1. Initialize a tree with a single vertex, chosen arbitrarily from the graph. 2. Grow the tree by one edge: of the edges that connect the tree to vertices not yet

Διαβάστε περισσότερα

Graph Algorithms. Παρουσίαση στα πλαίσια του μαθήματος «Παράλληλοι Αλγόριθμοι» Καούρη Γεωργία Μήτσου Βασιλική

Graph Algorithms. Παρουσίαση στα πλαίσια του μαθήματος «Παράλληλοι Αλγόριθμοι» Καούρη Γεωργία Μήτσου Βασιλική Graph Algorithms Παρουσίαση στα πλαίσια του μαθήματος «Παράλληλοι Αλγόριθμοι» Καούρη Γεωργία Μήτσου Βασιλική Περιεχόμενα minimum weight spanning tree connected components transitive closure shortest paths

Διαβάστε περισσότερα

Ενότητα 9 Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find)

Ενότητα 9 Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find) Ενότητα 9 (Union-Find) ΗΥ240 - Παναγιώτα Φατούρου 1 Έστω ότι S 1,, S k είναι ξένα υποσύνολα ενός συνόλου U, δηλαδή ισχύει ότι S i S j =, για κάθε i,j µε i j και S 1 S k = U. Λειτουργίες q MakeSet(X): επιστρέφει

Διαβάστε περισσότερα

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in : tail in X, head in A nowhere-zero Γ-flow is a Γ-circulation such that

Διαβάστε περισσότερα

ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΑΝΑΛΥΣΗ ΑΛΓΟΡΙΘΜΩΝ

ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΑΝΑΛΥΣΗ ΑΛΓΟΡΙΘΜΩΝ ΕΙΣΑΓΩΓΗ ΣΤΗΝ ΑΝΑΛΥΣΗ ΑΛΓΟΡΙΘΜΩΝ Ενότητα 11: Minimum Spanning Trees Αλγόριθμος Prim Αλγόριθμος Kruskal Μαρία Σατρατζέμη Τμήμα Εφαρμοσμένης Πληροφορικής Άδειες Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται

Διαβάστε περισσότερα

4. GREEDY ALGORITHMS II

4. GREEDY ALGORITHMS II 4. GREEDY ALGORITHMS II Dijkstra's algorithm minimum spanning trees Prim, Kruskal, Boruvka single-link clustering min-cost arborescences Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley

Διαβάστε περισσότερα

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Δομές Δεδομένων. Ιωάννης Γ. Τόλλης Τμήμα Επιστήμης Υπολογιστών Πανεπιστήμιο Κρήτης

ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ. Δομές Δεδομένων. Ιωάννης Γ. Τόλλης Τμήμα Επιστήμης Υπολογιστών Πανεπιστήμιο Κρήτης ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Δομές Δεδομένων Ιωάννης Γ. Τόλλης Τμήμα Επιστήμης Υπολογιστών Πανεπιστήμιο Κρήτης Χρηματοδότηση Το παρόν εκπαιδευτικό υλικό έχει αναπτυχθεί στα πλαίσια του εκπαιδευτικού

Διαβάστε περισσότερα

Αλγόριθµοι και Πολυπλοκότητα

Αλγόριθµοι και Πολυπλοκότητα Αλγόριθµοι και Πολυπλοκότητα Ενότητα 3 Αλγόριθµοι Γραφηµάτων Prim-Kruskal Ν. Μ. Μισυρλής Τµήµα Πληροφορικής και Τηλεπικοινωνιών, Καθηγητής: Ν. Μ. Μισυρλής Αλγόριθµοι και Πολυπλοκότητα - Ενότητα 3 Prim-Kruskal

Διαβάστε περισσότερα

Ενότητα 9 Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find)

Ενότητα 9 Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find) Ενότητα 9 Ξένα Σύνολα που υποστηρίζουν τη (Union-Find) ΗΥ240 - Παναγιώτα Φατούρου 1 Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης Έστω ότι S 1,, S k είναι ξένα υποσύνολα ενός συνόλου U, δηλαδή

Διαβάστε περισσότερα

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2)

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών NP-Completeness (2) x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 11 13 21

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

ΑΛΓΟΡΙΘΜΟΙ  Άνοιξη I. ΜΗΛΗΣ ΑΛΓΟΡΙΘΜΟΙ http://eclass.aueb.gr/courses/inf6/ Άνοιξη 26 - I. ΜΗΛΗΣ NP-complete προβλήματα ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ 26 - Ι. ΜΗΛΗΣ 6 NP-COMPLETENESS II Tree of reductions (partial) Cook s Th. Π NP SAT 3-SAT

Διαβάστε περισσότερα

EE512: Error Control Coding

EE512: Error Control Coding EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3

Διαβάστε περισσότερα

Αλγόριθμοι Γραφημάτων

Αλγόριθμοι Γραφημάτων Αλγόριθμοι Γραφημάτων 1. Minimum Spanning Trees 2. Αλγόριθμος Prim 3. Αλγόριθμος Kruskal Εισαγωγή στην Ανάλυση Αλγορίθμων Μάγια Σατρατζέμη Minimum Spanning Tree Πρόβλημα: Για δοσμένο συνεκτικό, μη προσανατολισμένο,

Διαβάστε περισσότερα

Αλγόριθμοι και Πολυπλοκότητα

Αλγόριθμοι και Πολυπλοκότητα Αλγόριθμοι και Πολυπλοκότητα Άπληστοι Αλγόριθμοι Δημήτρης Μιχαήλ Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο Άπληστοι Αλγόριθμοι Είναι δύσκολο να ορίσουμε ακριβώς την έννοια του άπληστου

Διαβάστε περισσότερα

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible. B-Trees Index files can become quite large for large main files Indices on index files are possible 3 rd -level index 2 nd -level index 1 st -level index Main file 1 The 1 st -level index consists of pairs

Διαβάστε περισσότερα

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?

ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =? Teko Classes IITJEE/AIEEE Maths by SUHAAG SIR, Bhopal, Ph (0755) 3 00 000 www.tekoclasses.com ANSWERSHEET (TOPIC DIFFERENTIAL CALCULUS) COLLECTION # Question Type A.Single Correct Type Q. (A) Sol least

Διαβάστε περισσότερα

Finite Field Problems: Solutions

Finite Field Problems: Solutions Finite Field Problems: Solutions 1. Let f = x 2 +1 Z 11 [x] and let F = Z 11 [x]/(f), a field. Let Solution: F =11 2 = 121, so F = 121 1 = 120. The possible orders are the divisors of 120. Solution: The

Διαβάστε περισσότερα

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ting Zhang Stanford May 11, 2001 Stanford, 5/11/2001 1 Outline Ordinal Classification Ordinal Addition Ordinal Multiplication Ordinal

Διαβάστε περισσότερα

HY380 Αλγόριθμοι και πολυπλοκότητα Hard Problems

HY380 Αλγόριθμοι και πολυπλοκότητα Hard Problems HY380 Αλγόριθμοι και πολυπλοκότητα Hard Problems Ημερομηνία Παράδοσης: 0/1/017 την ώρα του μαθήματος ή με email: mkarabin@csd.uoc.gr Γενικές Οδηγίες α) Επιτρέπεται η αναζήτηση στο Internet και στην βιβλιοθήκη

Διαβάστε περισσότερα

Every set of first-order formulas is equivalent to an independent set

Every set of first-order formulas is equivalent to an independent set Every set of first-order formulas is equivalent to an independent set May 6, 2008 Abstract A set of first-order formulas, whatever the cardinality of the set of symbols, is equivalent to an independent

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

ΑΛΓΟΡΙΘΜΟΙ  Άνοιξη I. ΜΗΛΗΣ ΑΛΓΟΡΙΘΜΟΙ http://eclass.aueb.gr/courses/inf161/ Άνοιξη 2016 - I. ΜΗΛΗΣ ΔΥΝΑΜΙΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ 2016 - Ι. ΜΗΛΗΣ 08 DP I 1 Dynamic Programming Richard Bellman (1953) Etymology (at

Διαβάστε περισσότερα

Δομές δεδομένων. Ενότητα 8: Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find) Παναγιώτα Φατούρου Τμήμα Επιστήμης Υπολογιστών

Δομές δεδομένων. Ενότητα 8: Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find) Παναγιώτα Φατούρου Τμήμα Επιστήμης Υπολογιστών ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Δομές δεδομένων Ενότητα 8: Ξένα Σύνολα που υποστηρίζουν τη λειτουργία της Ένωσης (Union-Find) Παναγιώτα Φατούρου Τμήμα Επιστήμης Υπολογιστών Ενότητα 8 Ξένα Σύνολα

Διαβάστε περισσότερα

Επίλυση Προβληµάτων µε Greedy Αλγόριθµους

Επίλυση Προβληµάτων µε Greedy Αλγόριθµους Επίλυση Προβληµάτων µε Greedy Αλγόριθµους Περίληψη Επίλυση προβληµάτων χρησιµοποιώντας Greedy Αλγόριθµους Ελάχιστα Δέντρα Επικάλυψης Αλγόριθµος του Prim Αλγόριθµος του Kruskal Πρόβληµα Ελάχιστης Απόστασης

Διαβάστε περισσότερα

Αλγόριθμοι Eλάχιστα μονοπάτια

Αλγόριθμοι Eλάχιστα μονοπάτια Αλγόριθμοι Eλάχιστα μονοπάτια Μάρθα Σιδέρη Προτεινόμενη βιβλιογραφία: S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani «Αλγόριθμοι» Κλειδάριθμος 009 Κεφάλαιο. http://www.cs.berkeley.edu/~vazirani/algorithms/chap.pdf

Διαβάστε περισσότερα

AVL-trees C++ implementation

AVL-trees C++ implementation Τ Μ Η Μ Α Μ Η Χ Α Ν Ι Κ Ω Ν Η / Υ Κ Α Ι Π Λ Η Ρ Ο Φ Ο Ρ Ι Κ Η Σ AVL-trees C++ implementation Δομές Δεδομένων Μάριος Κενδέα 31 Μαρτίου 2015 kendea@ceid.upatras.gr Εισαγωγή (1/3) Δυαδικά Δένδρα Αναζήτησης:

Διαβάστε περισσότερα

2 Composition. Invertible Mappings

2 Composition. Invertible Mappings Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,

Διαβάστε περισσότερα

Αλγόριθµοι και Πολυπλοκότητα

Αλγόριθµοι και Πολυπλοκότητα Αλγόριθµοι και Πολυπλοκότητα Ν. Μ. Μισυρλής Τµήµα Πληροφορικής και Τηλεπικοινωνιών, Πανεπιστήµιο Αθηνών Καθηγητής: Ν. Μ. Μισυρλής () Αλγόριθµοι και Πολυπλοκότητα 6 Μαΐου 2015 1 / 42 Εύρεση Ελάχιστου Μονοπατιού

Διαβάστε περισσότερα

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions SCHOOL OF MATHEMATICAL SCIENCES GLMA Linear Mathematics 00- Examination Solutions. (a) i. ( + 5i)( i) = (6 + 5) + (5 )i = + i. Real part is, imaginary part is. (b) ii. + 5i i ( + 5i)( + i) = ( i)( + i)

Διαβάστε περισσότερα

Statistical Inference I Locally most powerful tests

Statistical Inference I Locally most powerful tests Statistical Inference I Locally most powerful tests Shirsendu Mukherjee Department of Statistics, Asutosh College, Kolkata, India. shirsendu st@yahoo.co.in So far we have treated the testing of one-sided

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

ΑΛΓΟΡΙΘΜΟΙ  Άνοιξη I. ΜΗΛΗΣ ΑΛΓΟΡΙΘΜΟΙ http://eclass.aueb.gr/courses/inf161/ Άνοιξη 216 - I. ΜΗΛΗΣ ΔΥΝΑΜΙΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ 216 - Ι. ΜΗΛΗΣ 9 DP II 1 Dynamic Programming ΓΕΝΙΚΗ ΙΔΕΑ 1. Ορισμός υπο-προβλήματος/ων

Διαβάστε περισσότερα

The challenges of non-stable predicates

The challenges of non-stable predicates The challenges of non-stable predicates Consider a non-stable predicate Φ encoding, say, a safety property. We want to determine whether Φ holds for our program. The challenges of non-stable predicates

Διαβάστε περισσότερα

ORDINAL ARITHMETIC JULIAN J. SCHLÖDER

ORDINAL ARITHMETIC JULIAN J. SCHLÖDER ORDINAL ARITHMETIC JULIAN J. SCHLÖDER Abstract. We define ordinal arithmetic and show laws of Left- Monotonicity, Associativity, Distributivity, some minor related properties and the Cantor Normal Form.

Διαβάστε περισσότερα

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =

Διαβάστε περισσότερα

Partition of weighted sets (problems with numbers)

Partition of weighted sets (problems with numbers) TOPICS IN ALGORITHMS http://eclass.aueb.gr/courses/inf7/ Spring 27 I. ΜILIS Partition of weighted sets (problems with numbers) AUEB / DoI / TOPICS IN ALGORITHMS / Spring 27 / I. MILIS / 6 - PARTITIONS

Διαβάστε περισσότερα

Αλγόριθμοι και πολυπλοκότητα Depth-First Search

Αλγόριθμοι και πολυπλοκότητα Depth-First Search ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα Depth-First Search Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών Depth-First Search A B D E C Depth-First Search 1 Outline and Reading

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

ΑΛΓΟΡΙΘΜΟΙ  Άνοιξη I. ΜΗΛΗΣ ΑΛΓΟΡΙΘΜΟΙ http://eclass.aueb.gr/courses/inf6/ Άνοιξη 06 - I. ΜΗΛΗΣ P NP και NP-complete προβλήματα (Κλάσεις Πολυπλοκότητας) ΑΛΓΟΡΙΘΜΟΙ - ΑΝΟΙΞΗ 06 - Ι. ΜΗΛΗΣ 5 NP-COMPLETENESS I Γιατί για πολλά προβλήματα

Διαβάστε περισσότερα

Σχεδιαση Αλγοριθμων -Τμημα Πληροφορικης ΑΠΘ - Κεφαλαιο 9ο

Σχεδιαση Αλγοριθμων -Τμημα Πληροφορικης ΑΠΘ - Κεφαλαιο 9ο Σχεδίαση Αλγορίθμων Άπληστοι Αλγόριθμοι http://delab.csd.auth.gr/~gounaris/courses/ad 1 Άπληστοι αλγόριθμοι Προβλήματα βελτιστοποίησης ηςλύνονται με μια σειρά επιλογών που είναι: εφικτές τοπικά βέλτιστες

Διαβάστε περισσότερα

ST5224: Advanced Statistical Theory II

ST5224: Advanced Statistical Theory II ST5224: Advanced Statistical Theory II 2014/2015: Semester II Tutorial 7 1. Let X be a sample from a population P and consider testing hypotheses H 0 : P = P 0 versus H 1 : P = P 1, where P j is a known

Διαβάστε περισσότερα

Reminders: linear functions

Reminders: linear functions Reminders: linear functions Let U and V be vector spaces over the same field F. Definition A function f : U V is linear if for every u 1, u 2 U, f (u 1 + u 2 ) = f (u 1 ) + f (u 2 ), and for every u U

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα είναι μικρότεροι το 1000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Διάρκεια: 3,5 ώρες Καλή

Διαβάστε περισσότερα

The Simply Typed Lambda Calculus

The Simply Typed Lambda Calculus Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and

Διαβάστε περισσότερα

Αλγόριθμοι Επανάληψη για πρόοδο

Αλγόριθμοι Επανάληψη για πρόοδο Αλγόριθμοι Επανάληψη για πρόοδο Προτεινόμενη βιβλιογραφία: S. Dasgupta, C.H. Papadimitriou, ad U.V. Vazirai «Αλγόριθμοι» Κλειδάριθμος 2009 Κεφάλαια 0,3,4,5. http://www.cs.berkeley.edu/~vazirai/algorithms/chap0.pdf

Διαβάστε περισσότερα

Matrices and Determinants

Matrices and Determinants Matrices and Determinants SUBJECTIVE PROBLEMS: Q 1. For what value of k do the following system of equations possess a non-trivial (i.e., not all zero) solution over the set of rationals Q? x + ky + 3z

Διαβάστε περισσότερα

Distances in Sierpiński Triangle Graphs

Distances in Sierpiński Triangle Graphs Distances in Sierpiński Triangle Graphs Sara Sabrina Zemljič joint work with Andreas M. Hinz June 18th 2015 Motivation Sierpiński triangle introduced by Wac law Sierpiński in 1915. S. S. Zemljič 1 Motivation

Διαβάστε περισσότερα

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β 3.4 SUM AND DIFFERENCE FORMULAS Page Theorem cos(αβ cos α cos β -sin α cos(α-β cos α cos β sin α NOTE: cos(αβ cos α cos β cos(α-β cos α -cos β Proof of cos(α-β cos α cos β sin α Let s use a unit circle

Διαβάστε περισσότερα

Other Test Constructions: Likelihood Ratio & Bayes Tests

Other Test Constructions: Likelihood Ratio & Bayes Tests Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :

Διαβάστε περισσότερα

Ελάχιστο Συνδετικό Δέντρο

Ελάχιστο Συνδετικό Δέντρο Ελάχιστο Συνδετικό Δέντρο Διδάσκοντες: Σ. Ζάχος, Δ. Φωτάκης Επιμέλεια διαφανειών: Δ. Φωτάκης Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Εθνικό Μετσόβιο Πολυτεχνείο Ελάχιστο Συνδετικό Δέντρο

Διαβάστε περισσότερα

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch: HOMEWORK 4 Problem a For the fast loading case, we want to derive the relationship between P zz and λ z. We know that the nominal stress is expressed as: P zz = ψ λ z where λ z = λ λ z. Therefore, applying

Διαβάστε περισσότερα

Σχέσεις, Ιδιότητες, Κλειστότητες

Σχέσεις, Ιδιότητες, Κλειστότητες Σχέσεις, Ιδιότητες, Κλειστότητες Ορέστης Τελέλης telelis@unipi.gr Τµήµα Ψηφιακών Συστηµάτων, Πανεπιστήµιο Πειραιώς Ο. Τελέλης Πανεπιστήµιο Πειραιώς Σχέσεις 1 / 26 Εισαγωγή & Ορισµοί ιµελής Σχέση R από

Διαβάστε περισσότερα

Bounding Nonsplitting Enumeration Degrees

Bounding Nonsplitting Enumeration Degrees Bounding Nonsplitting Enumeration Degrees Thomas F. Kent Andrea Sorbi Università degli Studi di Siena Italia July 18, 2007 Goal: Introduce a form of Σ 0 2-permitting for the enumeration degrees. Till now,

Διαβάστε περισσότερα

Αλγόριθμοι Ταξινόμησης Μέρος 3

Αλγόριθμοι Ταξινόμησης Μέρος 3 Αλγόριθμοι Ταξινόμησης Μέρος 3 Μανόλης Κουμπαράκης 1 Ταξινόμηση με Ουρά Προτεραιότητας Θα παρουσιάσουμε τώρα δύο αλγόριθμους ταξινόμησης που χρησιμοποιούν μια ουρά προτεραιότητας για την υλοποίηση τους.

Διαβάστε περισσότερα

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required) Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts

Διαβάστε περισσότερα

The Probabilistic Method - Probabilistic Techniques. Lecture 7: The Janson Inequality

The Probabilistic Method - Probabilistic Techniques. Lecture 7: The Janson Inequality The Probabilistic Method - Probabilistic Techniques Lecture 7: The Janson Inequality Sotiris Nikoletseas Associate Professor Computer Engineering and Informatics Department 2014-2015 Sotiris Nikoletseas,

Διαβάστε περισσότερα

Κατ οίκον Εργασία 5 Σκελετοί Λύσεων

Κατ οίκον Εργασία 5 Σκελετοί Λύσεων Κατ οίκον Εργασία 5 Σκελετοί Λύσεων Άσκηση 1 Χρησιμοποιούμε τις δομές: struct hashtable { struct node array[maxsize]; int maxsize; int size; struct node{ int data; int status; Στο πεδίο status σημειώνουμε

Διαβάστε περισσότερα

Approximation of distance between locations on earth given by latitude and longitude

Approximation of distance between locations on earth given by latitude and longitude Approximation of distance between locations on earth given by latitude and longitude Jan Behrens 2012-12-31 In this paper we shall provide a method to approximate distances between two points on earth

Διαβάστε περισσότερα

Ελάχιστο Συνδετικό Δέντρο

Ελάχιστο Συνδετικό Δέντρο Ελάχιστο Συνδετικό Δέντρο Διδάσκοντες: Σ. Ζάχος, Δ. Φωτάκης Επιμέλεια διαφανειών: Δ. Φωτάκης Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Εθνικό Μετσόβιο Πολυτεχνείο Ελάχιστο Συνδετικό Δέντρο

Διαβάστε περισσότερα

Ελάχιστο Συνδετικό Δέντρο

Ελάχιστο Συνδετικό Δέντρο Ελάχιστο Συνδετικό Δέντρο Δημήτρης Φωτάκης Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Εθνικό Μετσόβιο Πολυτεχνείο Ελάχιστο Συνδετικό Δέντρο (MST) Συνεκτικό μη-κατευθ. G(V, E, w) με βάρη Βάρος

Διαβάστε περισσότερα

Αλγόριθµοι και Πολυπλοκότητα

Αλγόριθµοι και Πολυπλοκότητα Αλγόριθµοι και Πολυπλοκότητα Ενότητα 3 Αλγόριθµοι Γραφηµάτων Dijkstra Ν. Μ. Μισυρλής Τµήµα Πληροφορικής και Τηλεπικοινωνιών, Καθηγητής: Ν. Μ. Μισυρλής Αλγόριθµοι και Πολυπλοκότητα - Ενότητα 3 Dijkstra

Διαβάστε περισσότερα

Ελάχιστο Συνδετικό έντρο

Ελάχιστο Συνδετικό έντρο Ελάχιστο Συνδετικό έντρο ημήτρης Φωτάκης Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Εθνικό Μετσόβιο Πολυτεχνείο Ελάχιστο Συνδετικό έντρο (MST) Συνεκτικό μη-κατευθ. G(V, E, w) με βάρη Βάρος

Διαβάστε περισσότερα

C.S. 430 Assignment 6, Sample Solutions

C.S. 430 Assignment 6, Sample Solutions C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ Άνοιξη I. ΜΗΛΗΣ

ΑΛΓΟΡΙΘΜΟΙ  Άνοιξη I. ΜΗΛΗΣ ΑΛΓΟΡΙΘΜΟΙ http://eclass.aueb.gr/courses/inf161/ Άνοιξη 2016 - I. ΜΗΛΗΣ ΑΠΛΗΣΤΟΙ ΑΛΓΟΡΙΘΜΟΙ Greedy Algorithms 1 Greedy algorithms H βασική ιδέα: Άρχισε από ένα υπο-πρόβλημα μικρού μεγέθους Επαναληπτικά,

Διαβάστε περισσότερα

Στοιχεία Θεωρίας Γράφων (Graph Theory)

Στοιχεία Θεωρίας Γράφων (Graph Theory) Στοιχεία Θεωρίας Γράφων (Graph Theory) Ε Εξάμηνο, Τμήμα Πληροφορικής & Τεχνολογίας Υπολογιστών ΤΕΙ Λαμίας plam@inf.teilam.gr, Οι διαφάνειες βασίζονται στα βιβλία:. Αλγόριθμοι, Σχεδιασμός & Ανάλυση, η έκδοση,

Διαβάστε περισσότερα

Mean-Variance Analysis

Mean-Variance Analysis Mean-Variance Analysis Jan Schneider McCombs School of Business University of Texas at Austin Jan Schneider Mean-Variance Analysis Beta Representation of the Risk Premium risk premium E t [Rt t+τ ] R1

Διαβάστε περισσότερα

ΕΡΓΑΣΙΑ ΣΤΟ ΜΑΘΗΜΑ Λ03Β ΑΛΓΟΡΙΘΜΟΙ ΔΙΚΤΥΩΝ & ΠΟΛΥΠΛΟΚΟΤΗΤΑ ΦΛΕΒΑΡΗΣ 2004

ΕΡΓΑΣΙΑ ΣΤΟ ΜΑΘΗΜΑ Λ03Β ΑΛΓΟΡΙΘΜΟΙ ΔΙΚΤΥΩΝ & ΠΟΛΥΠΛΟΚΟΤΗΤΑ ΦΛΕΒΑΡΗΣ 2004 ΕΡΓΑΣΙΑ ΣΤΟ ΜΑΘΗΜΑ Λ03Β ΑΛΓΟΡΙΘΜΟΙ ΔΙΚΤΥΩΝ & ΠΟΛΥΠΛΟΚΟΤΗΤΑ ΦΛΕΒΑΡΗΣ 2004 Παρουσίαση του paper: Increasing the Weight of Minimum Spanning Trees Greg N. Frederickson and Roberto Solis- Oba Journal of Algorithms

Διαβάστε περισσότερα

Ελάχιστο Συνδετικό έντρο

Ελάχιστο Συνδετικό έντρο Ελάχιστο Συνδετικό έντρο ιδάσκοντες: Σ. Ζάχος,. Φωτάκης Επιμέλεια διαφανειών:. Φωτάκης Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Εθνικό Μετσόβιο Πολυτεχνείο Άδεια Χρήσης Το παρόν εκπαιδευτικό

Διαβάστε περισσότερα

w o = R 1 p. (1) R = p =. = 1

w o = R 1 p. (1) R = p =. = 1 Πανεπιστήµιο Κρήτης - Τµήµα Επιστήµης Υπολογιστών ΗΥ-570: Στατιστική Επεξεργασία Σήµατος 205 ιδάσκων : Α. Μουχτάρης Τριτη Σειρά Ασκήσεων Λύσεις Ασκηση 3. 5.2 (a) From the Wiener-Hopf equation we have:

Διαβάστε περισσότερα

Homework 8 Model Solution Section

Homework 8 Model Solution Section MATH 004 Homework Solution Homework 8 Model Solution Section 14.5 14.6. 14.5. Use the Chain Rule to find dz where z cosx + 4y), x 5t 4, y 1 t. dz dx + dy y sinx + 4y)0t + 4) sinx + 4y) 1t ) 0t + 4t ) sinx

Διαβάστε περισσότερα

ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ

ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ ΗΜΥ 311: Διακριτή Ανάλυση και Δομές Χειμερινό Εξάμηνο 016 Σειρά Ασκήσεων 5: Απαρίθμηση, Αρχή της Θυρίδας, Συνδυασμοί και Μεταθέσεις, Γραφήματα και

Διαβάστε περισσότερα

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Συστήματα Διαχείρισης Βάσεων Δεδομένων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 9: Transactions - part 1 Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών Tutorial on Undo, Redo and Undo/Redo

Διαβάστε περισσότερα

Section 8.3 Trigonometric Equations

Section 8.3 Trigonometric Equations 99 Section 8. Trigonometric Equations Objective 1: Solve Equations Involving One Trigonometric Function. In this section and the next, we will exple how to solving equations involving trigonometric functions.

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Αν κάπου κάνετε κάποιες υποθέσεις να αναφερθούν στη σχετική ερώτηση. Όλα τα αρχεία που αναφέρονται στα προβλήματα βρίσκονται στον ίδιο φάκελο με το εκτελέσιμο

Διαβάστε περισσότερα

Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1

Main source: Discrete-time systems and computer control by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1 Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1 A Brief History of Sampling Research 1915 - Edmund Taylor Whittaker (1873-1956) devised a

Διαβάστε περισσότερα

Example Sheet 3 Solutions

Example Sheet 3 Solutions Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note

Διαβάστε περισσότερα

derivation of the Laplacian from rectangular to spherical coordinates

derivation of the Laplacian from rectangular to spherical coordinates derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used

Διαβάστε περισσότερα

Uniform Convergence of Fourier Series Michael Taylor

Uniform Convergence of Fourier Series Michael Taylor Uniform Convergence of Fourier Series Michael Taylor Given f L 1 T 1 ), we consider the partial sums of the Fourier series of f: N 1) S N fθ) = ˆfk)e ikθ. k= N A calculation gives the Dirichlet formula

Διαβάστε περισσότερα

Δομές Δεδομένων & Αλγόριθμοι

Δομές Δεδομένων & Αλγόριθμοι - Δυαδικά Δένδρα (binary trees) - Δυαδικά Δένδρα Αναζήτησης (binary search trees) 1 Δυαδικά Δένδρα Ορισμοί Λειτουργίες Υλοποιήσεις ΑΤΔ Εφαρμογές 2 Ορισμοί (αναδρομικός ορισμός) Ένα δένδρο t είναι ένα πεπερασμένο

Διαβάστε περισσότερα

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω 0 1 2 3 4 5 6 ω ω + 1 ω + 2 ω + 3 ω + 4 ω2 ω2 + 1 ω2 + 2 ω2 + 3 ω3 ω3 + 1 ω3 + 2 ω4 ω4 + 1 ω5 ω 2 ω 2 + 1 ω 2 + 2 ω 2 + ω ω 2 + ω + 1 ω 2 + ω2 ω 2 2 ω 2 2 + 1 ω 2 2 + ω ω 2 3 ω 3 ω 3 + 1 ω 3 + ω ω 3 +

Διαβάστε περισσότερα

Διάλεξη 16: Σωροί. Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: - Ουρές Προτεραιότητας - Ο ΑΤΔ Σωρός, Υλοποίηση και πράξεις

Διάλεξη 16: Σωροί. Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: - Ουρές Προτεραιότητας - Ο ΑΤΔ Σωρός, Υλοποίηση και πράξεις ΕΠΛ231 Δομές Δεδομένων και Αλγόριθμοι 1 Διάλεξη 16: Σωροί Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: - Ουρές Προτεραιότητας - Ο ΑΤΔ Σωρός, Υλοποίηση και πράξεις Ουρά Προτεραιότητας (Priority

Διαβάστε περισσότερα

Capacitors - Capacitance, Charge and Potential Difference

Capacitors - Capacitance, Charge and Potential Difference Capacitors - Capacitance, Charge and Potential Difference Capacitors store electric charge. This ability to store electric charge is known as capacitance. A simple capacitor consists of 2 parallel metal

Διαβάστε περισσότερα

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8  questions or comments to Dan Fetter 1 Eon : Fall 8 Suggested Solutions to Problem Set 8 Email questions or omments to Dan Fetter Problem. Let X be a salar with density f(x, θ) (θx + θ) [ x ] with θ. (a) Find the most powerful level α test

Διαβάστε περισσότερα

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R + Chapter 3. Fuzzy Arithmetic 3- Fuzzy arithmetic: ~Addition(+) and subtraction (-): Let A = [a and B = [b, b in R If x [a and y [b, b than x+y [a +b +b Symbolically,we write A(+)B = [a (+)[b, b = [a +b

Διαβάστε περισσότερα

TMA4115 Matematikk 3

TMA4115 Matematikk 3 TMA4115 Matematikk 3 Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet Trondheim Spring 2010 Lecture 12: Mathematics Marvellous Matrices Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet

Διαβάστε περισσότερα

Multicut and Integer Multicomodity Flow in Trees (chap. 18) Αγγελής Γιώργος

Multicut and Integer Multicomodity Flow in Trees (chap. 18) Αγγελής Γιώργος Multicut and Integer Multicomodity Flow in Trees (chap. 18) Αγγελής Γιώργος Εισαγωγή Εύρεση αλγορίθμου με approx ratio 2 και ½ για τα προβλήματα minimum multicut και integer multicommodity flow αντίστοιχα

Διαβάστε περισσότερα

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is

Pg The perimeter is P = 3x The area of a triangle is. where b is the base, h is the height. In our case b = x, then the area is Pg. 9. The perimeter is P = The area of a triangle is A = bh where b is the base, h is the height 0 h= btan 60 = b = b In our case b =, then the area is A = = 0. By Pythagorean theorem a + a = d a a =

Διαβάστε περισσότερα

Lecture 13 - Root Space Decomposition II

Lecture 13 - Root Space Decomposition II Lecture 13 - Root Space Decomposition II October 18, 2012 1 Review First let us recall the situation. Let g be a simple algebra, with maximal toral subalgebra h (which we are calling a CSA, or Cartan Subalgebra).

Διαβάστε περισσότερα

Θεωρία Γραφημάτων Θεμελιώσεις-Αλγόριθμοι-Εφαρμογές

Θεωρία Γραφημάτων Θεμελιώσεις-Αλγόριθμοι-Εφαρμογές Θεωρία Γραφημάτων Θεμελιώσεις-Αλγόριθμοι-Εφαρμογές Ενότητα 8 ΤΕΛΕΙΑ ΓΡΑΦΗΜΑΤΑ Σταύρος Δ. Νικολόπουλος 2017-18 www.cs.uoi.gr/~stavros Εισαγωγή Βασικοί Αλγόριθμοι Γραφημάτων Πολυπλοκότητα χώρου και χρόνου:

Διαβάστε περισσότερα

ΑΛΓΟΡΙΘΜΟΙ. Ενότητα 9: Άπληστοι Αλγόριθμοι. Ιωάννης Μανωλόπουλος, Καθηγητής Αναστάσιος Γούναρης, Επίκουρος Καθηγητής Τμήμα Πληροφορικής ΑΠΘ

ΑΛΓΟΡΙΘΜΟΙ. Ενότητα 9: Άπληστοι Αλγόριθμοι. Ιωάννης Μανωλόπουλος, Καθηγητής Αναστάσιος Γούναρης, Επίκουρος Καθηγητής Τμήμα Πληροφορικής ΑΠΘ ΑΡΙΣΤΟΤΕΛΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΟΝΙΚΗΣ ΑΝΟΙΚΤΑ ΑΚΑΔΗΜΑΪΚΑ ΜΑΘΗΜΑΤΑ ΑΛΓΟΡΙΘΜΟΙ Ενότητα 9: Άπληστοι Ιωάννης Μανωλόπουλος, Καθηγητής Αναστάσιος Γούναρης, Επίκουρος Καθηγητής Άδειες Χρήσης Το παρόν εκπαιδευτικό

Διαβάστε περισσότερα

A Note on Intuitionistic Fuzzy. Equivalence Relation

A Note on Intuitionistic Fuzzy. Equivalence Relation International Mathematical Forum, 5, 2010, no. 67, 3301-3307 A Note on Intuitionistic Fuzzy Equivalence Relation D. K. Basnet Dept. of Mathematics, Assam University Silchar-788011, Assam, India dkbasnet@rediffmail.com

Διαβάστε περισσότερα

On a four-dimensional hyperbolic manifold with finite volume

On a four-dimensional hyperbolic manifold with finite volume BULETINUL ACADEMIEI DE ŞTIINŢE A REPUBLICII MOLDOVA. MATEMATICA Numbers 2(72) 3(73), 2013, Pages 80 89 ISSN 1024 7696 On a four-dimensional hyperbolic manifold with finite volume I.S.Gutsul Abstract. In

Διαβάστε περισσότερα

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Chapter 6: Systems of Linear Differential. be continuous functions on the interval Chapter 6: Systems of Linear Differential Equations Let a (t), a 2 (t),..., a nn (t), b (t), b 2 (t),..., b n (t) be continuous functions on the interval I. The system of n first-order differential equations

Διαβάστε περισσότερα

Models for Probabilistic Programs with an Adversary

Models for Probabilistic Programs with an Adversary Models for Probabilistic Programs with an Adversary Robert Rand, Steve Zdancewic University of Pennsylvania Probabilistic Programming Semantics 2016 Interactive Proofs 2/47 Interactive Proofs 2/47 Interactive

Διαβάστε περισσότερα

Δομές Δεδομένων Ενότητα 5

Δομές Δεδομένων Ενότητα 5 ΑΡΙΣΤΟΤΕΛΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΟΝΙΚΗΣ ΑΝΟΙΚΤΑ ΑΚΑΔΗΜΑΪΚΑ ΜΑΘΗΜΑΤΑ Ενότητα 5: Δυαδικά Δένδρα Απόστολος Παπαδόπουλος Άδειες Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται σε άδειες χρήσης Creative Commons.

Διαβάστε περισσότερα

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1 Conceptual Questions. State a Basic identity and then verify it. a) Identity: Solution: One identity is cscθ) = sinθ) Practice Exam b) Verification: Solution: Given the point of intersection x, y) of the

Διαβάστε περισσότερα

Αλγόριθμοι και πολυπλοκότητα Περιήγηση Πανεπιστημίων

Αλγόριθμοι και πολυπλοκότητα Περιήγηση Πανεπιστημίων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα Περιήγηση Πανεπιστημίων Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών Περιήγηση Πανεπιστημίων 5/8/008 :46 AM Campus Tour Περίληψη και ανάγνωση

Διαβάστε περισσότερα

5. Choice under Uncertainty

5. Choice under Uncertainty 5. Choice under Uncertainty Daisuke Oyama Microeconomics I May 23, 2018 Formulations von Neumann-Morgenstern (1944/1947) X: Set of prizes Π: Set of probability distributions on X : Preference relation

Διαβάστε περισσότερα