dfs

package
v0.0.0-...-6b870f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2014 License: BSD-2-Clause Imports: 3 Imported by: 0

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 depth-first-search algorithm for graphs

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)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Example_001_DFSSearch

func Example_001_DFSSearch()

Types

type DepthFirstSearch

type DepthFirstSearch struct {
	// contains filtered or unexported fields
}

func New

func New(G graph.GraphOps, sv int32) (dfs *DepthFirstSearch)

func (*DepthFirstSearch) ConnectedVertices

func (dfs *DepthFirstSearch) ConnectedVertices() (vertex_list []int32)

returns the list of vertices that are connected to the source vertex

func (*DepthFirstSearch) Count

func (dfs *DepthFirstSearch) Count() int32

func (*DepthFirstSearch) Path

func (dfs *DepthFirstSearch) Path(dest int32) (path []int32)

enumerate the source -> destination path in the DepthFirstSearch object

func (*DepthFirstSearch) PathExistsTo

func (dfs *DepthFirstSearch) PathExistsTo(dest int32) bool

returns true if a path source -> destination exists in the DepthFirstSearch object

func (*DepthFirstSearch) Visited

func (dfs *DepthFirstSearch) Visited(v int32) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL