You are on page 1of 6

ΕΘΝΙΚΟ ΚΑΙ ΚΑΠΟΔΙΣΤΡΙΑΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΑΘΗΝΩΝ

ΣΧΟΛΗ ΘΕΤΙΚΩΝ ΕΠΙΣΤΗΜΩΝ


ΤΜΗΜΑ ΦΥΣΙΚΗΣ
ΠΜΣ ΣΤΟΝ ΗΛΕΚΤΡΟΝΙΚΟ ΑΥΤΟΜΑΤΙΣΜΟ

Εργασία Μαθήματος

«Δομές Δεδομένων και Αλγόριθμοι»

Τίτλος Εργασίας Αναπαράσταση Γράφου με Γειτονικό Πίνακα, Εκτέλεση


BFS, Δημιουργία Spanning Tree και Εύρεση Κύκλων
(PROJECT 1/2021)
Επιβλέπων Καθηγητής Ρεΐσης Διονύσιος
Όνομα Φοιτητή Βασίλειος Μπεζαΐτης (AM 7110132100211)

Ημερομηνία Νοέμβριος 2021


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

Περίπτωση Χρήσης
Ο παρακάτω γράφος (Vertices:8)

Γειτονικός Πίνακας του γράφου

{0, 1, 1, 0, 0, 0, 0, 0,

1, 0, 0, 0, 0, 0, 1, 1,

1, 0, 0, 1, 1, 0, 0, 0,

0, 0, 1, 0, 1, 1, 0, 0,

0, 0, 1, 1, 0, 0, 0, 0,

0, 0, 0, 1, 0, 0, 0, 0,

0, 1, 0, 0, 0, 0, 0, 0,

0, 1, 0, 0, 0, 0, 0, 0}
Εκτέλεση Προγράμματος
MSc in Command and Computing

----------------------------

Data Structures and Algorithms : Project 1 - 2021 | Represent an Undirected Graph with an
Adjacency Matrix, do BFS, find Minimum Spanning Tree and Search for Circles

Professor : Mr. Dionysis REISIS

Student : Vasileios BEZAITIS

----------------------------

*** PROGRAM START ***

Enter number of vertices (MAX=30): 8

MAIN MENU

---------

1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)

5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 1

Enter an edge to be inserted : 0 1

Edge Added

---

ΕΠΑΝΑΛΗΨΗ ΓΙΑ ΟΛΕΣ ΤΙΣ ΠΑΡΑΚΑΤΩ ΠΕΡΙΠΤΩΣΕΙΣ

Enter an edge to be inserted : 0 2

Enter an edge to be inserted : 1 6

Enter an edge to be inserted : 1 7

Enter an edge to be inserted : 2 3

Enter an edge to be inserted : 2 4

Enter an edge to be inserted : 3 4


Enter an edge to be inserted : 3 5

Edge Added

---

MAIN MENU

---------

1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)

5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 3

Adjacency Matrix

----------------

01100000

10000011

10011000

00101100

00110000

00010000

01000000

01000000

MAIN MENU

---------

1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)


5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 4

Enter BFS Starting Point : 0

BFS Queue : 0 1 2 6 7 3 4 5

---

MAIN MENU

---------

1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)

5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 5

Minimum Spanning Tree :

Edge

0 ---> 1

0 ---> 2

1 ---> 6

1 ---> 7

2 ---> 3

2 ---> 4

3 ---> 5

---------

MAIN MENU

---------
1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)

5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 6

Has the Graph Circles : Yes

---------

MAIN MENU

---------

1.Insert an edge in the Graph

2.Delete an edge from the Graph

3.Print Adjacency Matrix (Representation of the Graph)

4.Do Breadth First Search (BFS)

5.Find and Print the Minimum Spanning Tree (MST)

6.Search for Circles in the Graph (Returns yes if a circle detected)

9.Exit

---------

Enter your choice : 9

*** PROGRAM FINISHED ***

You might also like