I had the same issue recently and ended up creating a NuGet package for this.
This implements a standard heap-based priority queue. It also has all the usual niceties of the BCL collections: ICollection<T>
and IReadOnlyCollection<T>
implementation, custom IComparer<T>
support, ability to specify an initial capacity, and a DebuggerTypeProxy
to make the collection easier to work with in the debugger.
There is also an Inline version of the package which just installs a single .cs file into your project (useful if you want to avoid taking externally-visible dependencies).
More information is available on the github page.