INNER CODE UNIT · Python

edges

steineggerlab/Metabuli · util/gtdb_to_taxdump.py:78

    def edges(self):
        """ returns the edges of a graph """
        return self.__generate_edges()

    def add_vertex(self, vertex):
        """ If the vertex "vertex" is not in 
            self.__graph_dict, a key "vertex" with an empty
            list as a value is added to the dictionary. 
            Otherwise nothing has to be done. 
        """
        if vertex not in self.__graph_dict:
            self.__graph_dict[vertex] = []
            self.__graph_nodeIDs[vertex] = len(self.__graph_nodeIDs.keys())+1

    def add_edge(self, vertex1, vertex2):
        """ assumes that edge is of type set, tuple or list; 
            between two vertices can be multiple edges! 
        """

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…