문제

JGraphT has a nice Fibonacci Heap class. How can I use it to implement Prim's minimum spanning tree algorithm?

도움이 되었습니까?

해결책

You'd have to write a wrapper class to rename the methods, since (from a cursory look through the JGraphT Javadocs) it doesn't looks like these developers implemented the Queue interface. So you have to write a method called offer that just calls insert, and so on. (Since this is open-source, you should consider making your edits right in the class itself, and sending the project your code when you're done.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top