C# Class CodingPractice.Graph.WeightedGraph

Inheritance: IWeightedGraph
显示文件 Open project: cabhishek/algorithms-datastructures Class Usage Examples

Public Properties

Property Type Description
NULL_EDGE int

Public Methods

Method Description
WeightedGraph ( ) : System.Collections
WeightedGraph ( int maxV ) : System.Collections
addEdge ( object fromVertex, object toVertex, int weight ) : void

Edge(from vertex, to vertex) is stored in edges

addVertex ( object vertex ) : void

vertex has been stored in vertices.

clearMarks ( ) : void

sets marks for all vertices to false

getToVertices ( object vertex ) : Queue

returns a queue of the vertices that are adjacent from vertex

isEmpty ( ) : bool
isFull ( ) : bool
isMarked ( object vertex ) : bool

determines if vertex has been marked or not

markVertex ( object vertex ) : void

sets mark for vertex to true

weightIs ( object fromVertex, object toVertex ) : int

returns weight associated with the edge

Private Methods

Method Description
indexIs ( object vertex ) : int

returns index of vertex in vertices

Method Details

WeightedGraph() public method

public WeightedGraph ( ) : System.Collections
return System.Collections

WeightedGraph() public method

public WeightedGraph ( int maxV ) : System.Collections
maxV int
return System.Collections

addEdge() public method

Edge(from vertex, to vertex) is stored in edges
public addEdge ( object fromVertex, object toVertex, int weight ) : void
fromVertex object
toVertex object
weight int
return void

addVertex() public method

vertex has been stored in vertices.
public addVertex ( object vertex ) : void
vertex object
return void

clearMarks() public method

sets marks for all vertices to false
public clearMarks ( ) : void
return void

getToVertices() public method

returns a queue of the vertices that are adjacent from vertex
public getToVertices ( object vertex ) : Queue
vertex object
return System.Collections.Queue

isEmpty() public method

public isEmpty ( ) : bool
return bool

isFull() public method

public isFull ( ) : bool
return bool

isMarked() public method

determines if vertex has been marked or not
public isMarked ( object vertex ) : bool
vertex object
return bool

markVertex() public method

sets mark for vertex to true
public markVertex ( object vertex ) : void
vertex object
return void

weightIs() public method

returns weight associated with the edge
public weightIs ( object fromVertex, object toVertex ) : int
fromVertex object
toVertex object
return int

Property Details

NULL_EDGE public_oe static_oe property

public static int NULL_EDGE
return int