Coder Social home page Coder Social logo

Comments (6)

nmoran avatar nmoran commented on August 28, 2024 1

That's good to know this. I'm happy for the issue to be closed. We know what the issue is and can avoid creating problematic hypergraphs. A warning from the Julia interface could be useful to help others diagnose such issues.

from kahypar.jl.

SebastianSchlag avatar SebastianSchlag commented on August 28, 2024

Hi,
thanks for reaching out.
@jalving I currently don't have a working Julia installation available and I am not familiar with SparseArrays. Do you have any thoughts on would could have gone wrong here?

I first guess would be that this creates a hypergraph that does not adhere to the hMetis format (see http://glaros.dtc.umn.edu/gkhome/fetch/sw/hmetis/manual.pdf Section 3.4).

from kahypar.jl.

nmoran avatar nmoran commented on August 28, 2024

Hi @SebastianSchlag , thanks for your reply. I looked into the hypergraph structure a little more and found there are many vertices that did not have any edges connected and many edges that do not connect any vertices. After removing these it is working. See example

using KaHyPar
using CSV
using DataFrames
using SparseArrays

df = CSV.read("problem_matrix.csv", DataFrame)
A = sparse(df.rows, df.cols, df.values)

non_empty_rows = findall(x -> x != 0, [nnz(A[i,:]) for i in 1:size(A)[1]])
non_empty_cols = findall(x -> x != 0, [nnz(A[:,i]) for i in 1:size(A)[2]])
B = A[non_empty_rows,non_empty_cols]

h = KaHyPar.hypergraph(B)
partitions = KaHyPar.partition(h, 2, configuration=:edge_cut)

from kahypar.jl.

SebastianSchlag avatar SebastianSchlag commented on August 28, 2024

Great! Thanks for clarifying. 👍 In genreal, vertices without any edges should not be a problem. However "empty" hyperedges won't work. Would it be okay to close this issue then?

from kahypar.jl.

jalving avatar jalving commented on August 28, 2024

@SebastianSchlag Thanks for addressing this so quickly. If it works for a correct hypergraph I think we can close.

It might be worth adding some input checks on the hypergraph structure. I could add this to the Julia interface unless you think input checking should go into the KaHyPar source.

from kahypar.jl.

SebastianSchlag avatar SebastianSchlag commented on August 28, 2024

Hi @jalving, if you find the time, I think it would be cool if you could add some general sanity checks to the Julia interface - then users could get native error messages in case the hypergraph is inconsistent.

from kahypar.jl.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.