Init - : Directedgraph: (Number - of - Vertices)
Init - : Directedgraph: (Number - of - Vertices)
def is_vertex(self,vertex):
"""
Description:
- checks if "vertex" is a vertex of the graph
Input:
- vertex being checked
Output:
- returns true if "vertex" is a vertex of the graph
- false, otherwise
Exceptions:
--
"""
def get_edges_number(self):
"""
Description:
- returns the number of edges
Input:
--
Output:
- the number of edges
Exceptions:
--
"""
def get_vertices_number(self):
"""
Description:
- returns the number of vertices
Input:
--
Output:
- the number of vertices
Exceptions:
--
"""
def iterate_vertices(self):
"""
Description:
- returns an iterator containing all the vertices
Input:
--
Output:
- the iterator containing all the vertices
"""
def get_copy(self):
"""
Description:
- returns a deep copy of the graph
Input:
--
Output:
- a deep copy of the graph
Exceptions:
--
"""
@staticmethod
def read_from_file(file_name):
"""
Description:
- reads a directed graph from a file and returns it
Input:
- fileName - the name of the file
Output:
- the graph that has been read from the file
"""
@staticmethod
def create_random_graph(number_vertices, number_edges, file_name='random.txt'):
"""
Description:
- creates a random graph with a given number of edges and vertices, and
writes it to a file
Input:
- numberOfVertices - the number of vertices
- numberOfEdges - the number of edges
- fileName - the name of the file the generated graph will be written
Output:
--
Exceptions:
- throws invalidArgument exception if the number of edges >
numberOfVertices*(numberOfVertices-1)
"""