Class FibonacciQueue<TVertex, TDistance>
Priority queue to sort vertices by distance priority (use FibonacciHeap<TPriority, TValue>).
Inheritance
Inherited Members
Namespace: QuikGraph.Collections
Assembly: QuikGraph.dll
Syntax
[Serializable]
public sealed class FibonacciQueue<TVertex, TDistance> : IPriorityQueue<TVertex>, IQueue<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TDistance | Distance type. |
Constructors
| Improve this Doc View SourceFibonacciQueue(Dictionary<TVertex, TDistance>)
Initializes a new instance of the FibonacciQueue<TVertex, TDistance> class.
Declaration
public FibonacciQueue(Dictionary<TVertex, TDistance> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<TVertex, TDistance> | values | Dictionary of vertices associates to their distance. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
FibonacciQueue(Dictionary<TVertex, TDistance>, Comparison<TDistance>)
Initializes a new instance of the FibonacciQueue<TVertex, TDistance> class.
Declaration
public FibonacciQueue(Dictionary<TVertex, TDistance> values, Comparison<TDistance> distanceComparison)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<TVertex, TDistance> | values | Dictionary of vertices associates to their distance. |
System.Comparison<TDistance> | distanceComparison | Comparer of distances. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
FibonacciQueue(Func<TVertex, TDistance>)
Initializes a new instance of the BinaryQueue<TVertex, TDistance> class.
Declaration
public FibonacciQueue(Func<TVertex, TDistance> distanceFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TVertex, TDistance> | distanceFunc | Function that compute the distance for a given vertex. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
FibonacciQueue(Int32, IEnumerable<TVertex>, Func<TVertex, TDistance>)
Initializes a new instance of the FibonacciQueue<TVertex, TDistance> class.
Declaration
public FibonacciQueue(int capacity, IEnumerable<TVertex> values, Func<TVertex, TDistance> distanceFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | Initial capacity. |
System.Collections.Generic.IEnumerable<TVertex> | values | Set of vertices (null if |
System.Func<TVertex, TDistance> | distanceFunc | Function that compute the distance for a given vertex. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
FibonacciQueue(Int32, IEnumerable<TVertex>, Func<TVertex, TDistance>, Comparison<TDistance>)
Initializes a new instance of the FibonacciQueue<TVertex, TDistance> class.
Declaration
public FibonacciQueue(int capacity, IEnumerable<TVertex> values, Func<TVertex, TDistance> distanceFunc, Comparison<TDistance> distanceComparison)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | Initial capacity. |
System.Collections.Generic.IEnumerable<TVertex> | values | Set of vertices (null if |
System.Func<TVertex, TDistance> | distanceFunc | Function that compute the distance for a given vertex. |
System.Comparison<TDistance> | distanceComparison | Comparer of distances. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
Properties
| Improve this Doc View SourceCount
Number of elements.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceContains(TVertex)
Checks if this queue contains the given value
.
Declaration
public bool Contains(TVertex value)
Parameters
Type | Name | Description |
---|---|---|
TVertex | value |
Returns
Type | Description |
---|---|
System.Boolean | True if the |
Dequeue()
Dequeues an element from the queue.
Declaration
public TVertex Dequeue()
Returns
Type | Description |
---|---|
TVertex | Removed element. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Queue is empty. |
Enqueue(TVertex)
Enqueues an element in the queue.
Declaration
public void Enqueue(TVertex value)
Parameters
Type | Name | Description |
---|---|---|
TVertex | value |
Peek()
Returns the element at the beginning of the queue.
Declaration
public TVertex Peek()
Returns
Type | Description |
---|---|
TVertex | The top queue element. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Queue is empty. |
ToArray()
Converts this queue to an array.
Declaration
public TVertex[] ToArray()
Returns
Type | Description |
---|---|
TVertex[] | Array composed of elements. |
Update(TVertex)
Updates the given value
priority.
Declaration
public void Update(TVertex value)
Parameters
Type | Name | Description |
---|---|---|
TVertex | value |