Show / Hide Table of Contents

Class FibonacciHeap<TPriority, TValue>

Heap following Fibonacci rules.

Inheritance
System.Object
FibonacciHeap<TPriority, TValue>
Implements
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TPriority, TValue>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Collections
Assembly: QuikGraph.dll
Syntax
[Serializable]
public sealed class FibonacciHeap<TPriority, TValue> : IEnumerable<KeyValuePair<TPriority, TValue>>, IEnumerable
Type Parameters
Name Description
TPriority

Priority metric type.

TValue

Value type.

Constructors

| Improve this Doc View Source

FibonacciHeap()

Initializes a new instance of the FibonacciHeap<TPriority, TValue> class.

Declaration
public FibonacciHeap()
| Improve this Doc View Source

FibonacciHeap(HeapDirection)

Initializes a new instance of the FibonacciHeap<TPriority, TValue> class.

Declaration
public FibonacciHeap(HeapDirection direction)
Parameters
Type Name Description
HeapDirection direction

Heap direction.

| Improve this Doc View Source

FibonacciHeap(HeapDirection, Comparison<TPriority>)

Initializes a new instance of the FibonacciHeap<TPriority, TValue> class.

Declaration
public FibonacciHeap(HeapDirection direction, Comparison<TPriority> priorityComparison)
Parameters
Type Name Description
HeapDirection direction

Heap direction.

System.Comparison<TPriority> priorityComparison

Priority comparer.

Exceptions
Type Condition
System.ArgumentNullException

priorityComparison is null.

Properties

| Improve this Doc View Source

Count

Number of element.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Direction

Heap direction.

Declaration
public HeapDirection Direction { get; }
Property Value
Type Description
HeapDirection
| Improve this Doc View Source

IsEmpty

Checks if the heap is empty.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PriorityComparison

Priority comparer.

Declaration
public Comparison<TPriority> PriorityComparison { get; }
Property Value
Type Description
System.Comparison<TPriority>
| Improve this Doc View Source

Top

Top element of the heap.

Declaration
public FibonacciHeapCell<TPriority, TValue> Top { get; }
Property Value
Type Description
FibonacciHeapCell<TPriority, TValue>

Methods

| Improve this Doc View Source

ChangeKey(FibonacciHeapCell<TPriority, TValue>, TPriority)

Changes the priority of the given cell.

Declaration
public void ChangeKey(FibonacciHeapCell<TPriority, TValue> cell, TPriority newPriority)
Parameters
Type Name Description
FibonacciHeapCell<TPriority, TValue> cell

Cell to update the priority.

TPriority newPriority

New priority.

Exceptions
Type Condition
System.ArgumentNullException

cell is null.

System.ArgumentNullException

newPriority is null.

| Improve this Doc View Source

Delete(FibonacciHeapCell<TPriority, TValue>)

Deletes the given cell from this heap.

Declaration
public void Delete(FibonacciHeapCell<TPriority, TValue> cell)
Parameters
Type Name Description
FibonacciHeapCell<TPriority, TValue> cell

Cell to delete.

Exceptions
Type Condition
System.ArgumentNullException

cell is null.

| Improve this Doc View Source

Dequeue()

Dequeues an element from the heap.

Declaration
public KeyValuePair<TPriority, TValue> Dequeue()
Returns
Type Description
System.Collections.Generic.KeyValuePair<TPriority, TValue>

Removed element.

Exceptions
Type Condition
System.InvalidOperationException

The heap is empty.

| Improve this Doc View Source

DrawHeap()

Draws the current heap in a string. Marked cells have an * next to them.

Declaration
public string DrawHeap()
Returns
Type Description
System.String

Heap string representation.

| Improve this Doc View Source

Enqueue(TPriority, TValue)

Enqueues an element in the heap.

Declaration
public FibonacciHeapCell<TPriority, TValue> Enqueue(TPriority priority, TValue value)
Parameters
Type Name Description
TPriority priority

Value priority.

TValue value

Value to add.

Returns
Type Description
FibonacciHeapCell<TPriority, TValue>
Exceptions
Type Condition
System.ArgumentNullException

priority is null.

| Improve this Doc View Source

GetDestructiveEnumerator()

Enumerator for this heap that Dequeue() elements in the same time.

Declaration
public IEnumerable<KeyValuePair<TPriority, TValue>> GetDestructiveEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TPriority, TValue>>

Heap elements.

| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator<KeyValuePair<TPriority, TValue>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TPriority, TValue>>
| Improve this Doc View Source

Merge(FibonacciHeap<TPriority, TValue>)

Merges the given heap into this heap.

Declaration
public void Merge(FibonacciHeap<TPriority, TValue> heap)
Parameters
Type Name Description
FibonacciHeap<TPriority, TValue> heap

Heap to merge.

Exceptions
Type Condition
System.ArgumentNullException

heap is null.

System.InvalidOperationException

heap is not in the same direction as this heap.

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
EdgeExtensions.IsPath<TVertex, TEdge>(IEnumerable<TEdge>)
EdgeExtensions.HasCycles<TVertex, TEdge>(IEnumerable<TEdge>)
EdgeExtensions.IsPathWithoutCycles<TVertex, TEdge>(IEnumerable<TEdge>)
GraphExtensions.ToDelegateVertexAndEdgeListGraph<TVertex, TEdge>(IEnumerable<TVertex>, TryFunc<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateVertexAndEdgeListGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateUndirectedGraph<TVertex, TEdge>(IEnumerable<TVertex>, TryFunc<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToDelegateUndirectedGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>)
GraphExtensions.ToAdjacencyGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
GraphExtensions.ToAdjacencyGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>, Boolean)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
GraphExtensions.ToBidirectionalGraph<TVertex, TEdge>(IEnumerable<TVertex>, Func<TVertex, IEnumerable<TEdge>>, Boolean)
GraphExtensions.ToUndirectedGraph<TVertex, TEdge>(IEnumerable<TEdge>, Boolean)
AlgorithmExtensions.IsDirectedAcyclicGraph<TVertex, TEdge>(IEnumerable<TEdge>)
AlgorithmExtensions.IsUndirectedAcyclicGraph<TVertex, TEdge>(IEnumerable<TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph