kahypar / KaHyPar.jl

KaHyPar.jl is a Julia interface to the KaHyPar multilevel hypergraph partitioning package.
Other
22 stars 7 forks source link

Improve initial partition with fixed vertices #1

Closed bodhi91 closed 4 years ago

bodhi91 commented 4 years ago

Hi,

I am aiming to improve an initial partition using the improve_partition function, however, this initial partition has a bunch of fixed vertices. Is there a way the existing Julia interface allows me to pass that info to the partitioner so that the refinement algorithm is aware of these fixed vertices?

Thanks

SebastianSchlag commented 4 years ago

Hi, thanks for reaching out. Unfortunately, this is currently not supported in the Julia interface and in the C interface. I think I'll have time to update the C interface sometime early next week. Perhaps @jalving can then update the Julia interface accordingly.

bodhi91 commented 4 years ago

Hi

Thanks for the quick reply Sebastian. :) That would be awesome.

jalving commented 4 years ago

I should be able to update the Julia interface not too long afterwards. You might have to setup your Julia environment to point to a custom build of KaHyPar. I can show you how to do that when we're ready.

bodhi91 commented 4 years ago

Thanks. Greatly appreciated.

SebastianSchlag commented 4 years ago

Hi everyone, I updated the C interface to support fixed vertices. The PR (https://github.com/kahypar/kahypar/pull/60) has been merged this morning.

bodhi91 commented 4 years ago

Thanks a lot Sebastian. @jalving please let me know how to work with the Julia end, whenever you have some time.

bodhi91 commented 4 years ago

Hi everyone, any update on this?

jalving commented 4 years ago

Hey @bodhi91. I should have some time in a few days to knock this out. I just graduated, so I have been a little pre-occupied. I'll get this done asap.

bodhi91 commented 4 years ago

Oh, heartiest congratulations. Didn't mean to spoil the fun. Please take your time. No worries at all.

SebastianSchlag commented 4 years ago

Hey @bodhi91. I should have some time in a few days to knock this out. I just graduated, so I have been a little pre-occupied. I'll get this done asap.

Congratulations, Jordan! 🎉

jalving commented 4 years ago

Thanks guys! Finally back. @SebastianSchlag : Do you have an example that uses the C interface to fix vertices? I am almost done updating the Julia interface, but I don't know how to specify free vertices in the fixed vertex block list. Based on the C function it expects unsigned integers, so I can't use -1 to specify a free vertex in my input.

SebastianSchlag commented 4 years ago

Welcome back! :)

Oh, good catch! Technically, -1 should still work but just wrap around to sth. like std::numeric_limits<int>::max(). However, I've just updated the interface such that kahypar_partition_id_t is now of type int (https://github.com/kahypar/kahypar/commit/328760c4fd4307be3c972bee814649863febc678).

jalving commented 4 years ago

Hey @bodhi91, can you try pulling the latest master than includes PR https://github.com/kahypar/KaHyPar.jl/pull/4? You will also need to re-build KaHyPar from the Julia interface (i.e. use build KaHyPar from the Julia package manager) which should grab the latest binary.

bodhi91 commented 4 years ago

@jalving it works perfectly. Thank you so much for helping me out with this. Appreciate it.

jalving commented 4 years ago

No problem. Just open a new issue if you run into any bugs.