Documentation ¶
Overview ¶
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Author: anupam.kapoor@gmail.com (Anupam Kapoor)
provides an implementation of breadth-first-search for graphs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BreadthFirstSearch ¶
type BreadthFirstSearch struct {
// contains filtered or unexported fields
}
a BreadthFirstSearch object enumerating a set of vertices that can be visited from a given source vertex
func (*BreadthFirstSearch) ConnectedVertices ¶
func (bfs *BreadthFirstSearch) ConnectedVertices() (vertex_list []int32)
returns the list of vertices that are connected to the source vertex
func (*BreadthFirstSearch) Count ¶
func (bfs *BreadthFirstSearch) Count() int32
func (*BreadthFirstSearch) Path ¶
func (bfs *BreadthFirstSearch) Path(dest int32) (path []int32)
enumerate the source -> destination path in the DepthFirstSearch object
func (*BreadthFirstSearch) PathExistsTo ¶
func (bfs *BreadthFirstSearch) PathExistsTo(dest int32) bool
returns true if a path source -> destination exists in the DepthFirstSearch object
func (*BreadthFirstSearch) Visited ¶
func (bfs *BreadthFirstSearch) Visited(v int32) bool