Class: RGL::AdjacencyGraph

### Home Classes Methods

### In Files

- lib/rgl/adjacency.rb

### Parent

RGL::DirectedAdjacencyGraph

### Methods

- #basic_add_edge
- #directed?
- #remove_edge

### Class/Module Index

Quicksearch

- RGL
- RGL::AdjacencyGraph
- RGL::BFSIterator
- RGL::BellmanFordAlgorithm
- RGL::BellmanFordVisitor
- RGL::BidirectionalGraph
- RGL::BipartiteBFSIterator
- RGL::DFSIterator
- RGL::DFSVisitor
- RGL::DOT
- RGL::DOT::Digraph
- RGL::DOT::DirectedEdge
- RGL::DOT::Edge
- RGL::DOT::Element
- RGL::DOT::Graph
- RGL::DOT::Node
- RGL::DOT::Port
- RGL::DOT::Subgraph
- RGL::DijkstraAlgorithm
- RGL::DijkstraVisitor
- RGL::DirectedAdjacencyGraph
- RGL::Edge
- RGL::Edge::DirectedEdge
- RGL::Edge::UnDirectedEdge
- RGL::EdgePropertiesMap
- RGL::EdmondsKarpAlgorithm
- RGL::EdmondsKarpAlgorithm::EdmondsKarpBFSIterator
- RGL::Graph
- RGL::Graph::TarjanSccVisitor
- RGL::GraphIterator
- RGL::GraphVisitor
- RGL::GraphVisitor::ClassMethods
- RGL::GraphVisitor::DistanceMapSupport
- RGL::ImplicitGraph
- RGL::MutableGraph
- RGL::MutableGraph::MutableGraphParser
- RGL::NoEdgeError
- RGL::NoVertexError
- RGL::NonNegativeEdgePropertiesMap
- RGL::NotDirectedError
- RGL::NotUndirectedError
- RGL::PrimAlgorithm
- RGL::TopsortIterator
- Enumerable
- Object

No matching classes.

# RGL::AdjacencyGraph

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.

### Public Instance Methods

directed?() click to toggle source

Always returns false.

    # File lib/rgl/adjacency.rb, line 152
    def directed?
      false
    end

remove_edge(u, v) click to toggle source

Also removes (v,u)

    # File lib/rgl/adjacency.rb, line 158
    def remove_edge(u, v)
      super
      @vertices_dict[v].delete(u) unless @vertices_dict[v].nil?
    end

### Protected Instance Methods

basic_add_edge(u, v) click to toggle source

    # File lib/rgl/adjacency.rb, line 165
    def basic_add_edge(u, v)
      super
      @vertices_dict[v].add(u) # Insert backwards edge
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.