Class: RGL::AdjacencyGraph

Inherits:
DirectedAdjacencyGraph show all
Defined in:
lib/laser/third_party/rgl/adjacency.rb

Overview

AdjacencyGraph is an undirected Graph. The methods add_edge and remove_edge are reimplemented: If an edge (u,v) is added or removed, then the reverse edge (v,u) is also added or removed.

Instance Method Summary collapse

Methods inherited from DirectedAdjacencyGraph

[], #add_edge, #add_vertex, #each_adjacent, #each_predecessor, #each_vertex, #edgelist_class=, #has_edge?, #has_vertex?, #initialize, #initialize_copy, #remove_vertex

Methods included from MutableGraph

#add_edge, #add_edges, #add_graph, #add_graphs, #add_vertex, #add_vertices, #cycles, #cycles_with_vertex, #from_graphxml, #remove_vertex, #remove_vertices

Methods included from Graph

#acyclic?, #adjacent_vertices, #bfs_iterator, #bfs_search_tree_from, #build_dfst, #condensation_graph, #depth_first_search, #depth_first_spanning_tree, #depth_first_visit, #dfs_iterator, #dominance_frontier, #dominator_tree, #dotty, #each, #each_adjacent, #each_connected_component, #each_edge, #each_vertex, #edge_class, #edges, #edges_filtered_by, #empty?, #eql?, #has_vertex?, #implicit_graph, #iterated_dominance_frontier, #num_edges, #out_degree, #print_dotted_on, #reverse, #size, #strongly_connected_components, #to_adjacency, #to_dot_graph, #to_s, #to_undirected, #topsort_iterator, #transitive_closure, #transitive_reduction, #vertices, #vertices_filtered_by, #write_to_graphic_file

Methods included from Enumerable

#all?, #any?, #chunk, #collect, #collect_concat, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #find_index, #first, #flat_map, #grep, #group_by, #include?, #inject, #map, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #select, #slice_before, #sort, #sort_by, #take, #take_while, #to_a, #to_set, #zip

Constructor Details

This class inherits a constructor from RGL::DirectedAdjacencyGraph

Instance Method Details

#directed?Boolean

Always returns false.



164
165
166
# File 'lib/laser/third_party/rgl/adjacency.rb', line 164

def directed?				# Always returns false.
  false
end

#remove_edge(u, v) ⇒ Object

Also removes (v,u)



170
171
172
173
# File 'lib/laser/third_party/rgl/adjacency.rb', line 170

def remove_edge (u, v)
  super
  @vertex_dict[v].delete(u) unless @vertex_dict[v].nil?
end