Repository: TheAlgorithms/Python

Issue:
2 Graph folders
There are 2 separate folder of Graph
1. Graph
2. Data Structures - > Graph

Merge them and keep the second one


Discussion:
Hi Anup ,May be I'm asking a really stupid question but I have a doubt . You want this folder thing to be done in github right ? Or is it in some location in your computer drive . Just wanted some clarification .
in the python repository, there is a graph folder and another folder called Data Structures - > Graph. 
You need to merge them. 
Clone this repo move the content of the folders and send a PR.
@AnupKumarPanwar  #120 is merged, can you please close this :)
The "data_structures/Graph/" still not properly merged.
There are 2 copies of same algo :-

Breadth_First_Search.py
Deep_First_Search.py

P01_BreadthFirstSearch.py
P02_DepthFirstSearch.py
@AnupKumarPanwar  so do we suppose to delete both?
```
P01_BreadthFirstSearch.py
P02_DepthFirstSearch.py
```
It seems like `Breadth_First_Search.py` and `Deep_First_Search.py` have some syntax issues.
`P01_BreadthFirstSearch.py` and `P02_DepthFirstSearch.py` can run and are documented.
Which two should be deleted? How would you like these programs to be merged?

Resolving patch:
diff --git a/data_structures/Graph/P01_BreadthFirstSearch.py b/data_structures/Graph/P01_BreadthFirstSearch.py
deleted file mode 100644
--- a/data_structures/Graph/P01_BreadthFirstSearch.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Author: OMKAR PATHAK
-
-class Graph():
-    def __init__(self):
-        self.vertex = {}
-
-    # for printing the Graph vertexes
-    def printGraph(self):
-        for i in self.vertex.keys():
-            print(i,' -> ', ' -> '.join([str(j) for j in self.vertex[i]]))
-
-    # for adding the edge beween two vertexes
-    def addEdge(self, fromVertex, toVertex):
-        # check if vertex is already present,
-        if fromVertex in self.vertex.keys():
-            self.vertex[fromVertex].append(toVertex)
-        else:
-            # else make a new vertex
-            self.vertex[fromVertex] = [toVertex]
-
-    def BFS(self, startVertex):
-        # Take a list for stoting already visited vertexes
-        visited = [False] * len(self.vertex)
-
-        # create a list to store all the vertexes for BFS
-        queue = []
-
-        # mark the source node as visited and enqueue it
-        visited[startVertex] = True
-        queue.append(startVertex)
-
-        while queue:
-            startVertex = queue.pop(0)
-            print(startVertex, end = ' ')
-
-            # mark all adjacent nodes as visited and print them
-            for i in self.vertex[startVertex]:
-                if visited[i] == False:
-                    queue.append(i)
-                    visited[i] = True
-
-if __name__ == '__main__':
-    g = Graph()
-    g.addEdge(0, 1)
-    g.addEdge(0, 2)
-    g.addEdge(1, 2)
-    g.addEdge(2, 0)
-    g.addEdge(2, 3)
-    g.addEdge(3, 3)
-
-    g.printGraph()
-    print('BFS:')
-    g.BFS(2)
-
-    # OUTPUT:
-    # 0  ->  1 -> 2
-    # 1  ->  2
-    # 2  ->  0 -> 3
-    # 3  ->  3
-    # BFS:
-    # 2 0 3 1
diff --git a/data_structures/Graph/P02_DepthFirstSearch.py b/data_structures/Graph/P02_DepthFirstSearch.py
deleted file mode 100644
--- a/data_structures/Graph/P02_DepthFirstSearch.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Author: OMKAR PATHAK
-
-class Graph():
-    def __init__(self):
-        self.vertex = {}
-
-    # for printing the Graph vertexes
-    def printGraph(self):
-        print(self.vertex)
-        for i in self.vertex.keys():
-            print(i,' -> ', ' -> '.join([str(j) for j in self.vertex[i]]))
-
-    # for adding the edge beween two vertexes
-    def addEdge(self, fromVertex, toVertex):
-        # check if vertex is already present,
-        if fromVertex in self.vertex.keys():
-            self.vertex[fromVertex].append(toVertex)
-        else:
-            # else make a new vertex
-            self.vertex[fromVertex] = [toVertex]
-
-    def DFS(self):
-        # visited array for storing already visited nodes
-        visited = [False] * len(self.vertex)
-
-        # call the recursive helper function
-        for i in range(len(self.vertex)):
-            if visited[i] == False:
-                self.DFSRec(i, visited)
-
-    def DFSRec(self, startVertex, visited):
-        # mark start vertex as visited
-        visited[startVertex] = True
-
-        print(startVertex, end = ' ')
-
-        # Recur for all the vertexes that are adjacent to this node
-        for i in self.vertex.keys():
-            if visited[i] == False:
-                self.DFSRec(i, visited)
-
-if __name__ == '__main__':
-    g = Graph()
-    g.addEdge(0, 1)
-    g.addEdge(0, 2)
-    g.addEdge(1, 2)
-    g.addEdge(2, 0)
-    g.addEdge(2, 3)
-    g.addEdge(3, 3)
-
-    g.printGraph()
-    print('DFS:')
-    g.DFS()
-
-    # OUTPUT:
-    # 0  ->  1 -> 2
-    # 1  ->  2
-    # 2  ->  0 -> 3
-    # 3  ->  3
-    # DFS:
-    # 0 1 2 3


Test patch: