Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barycenter returns what? #33

Open
deklanw opened this issue Jul 18, 2021 · 1 comment
Open

Barycenter returns what? #33

deklanw opened this issue Jul 18, 2021 · 1 comment

Comments

@deklanw
Copy link

deklanw commented Jul 18, 2021

I thought that the three values in the returned array are the permutations of the columns, the rows, and the number of crossings. But, I noticed in my results that the lengths of the permutations seem off.

Adding these two assertions to the tests in barycenter-test.js

  assert.isTrue(perms[0].length === mat[0].length)
  assert.isTrue(perms[1].length === mat.length)

causes a failure for the hard test, but not the simple test.

Am I missing something here? Thanks

@nvbeusekom
Copy link

nvbeusekom commented Jun 3, 2022

I believe the issue here is that vertices that have no edges connected to them disappear from the ordering.
They do show in the components, but they are omitted in the construction of the layers, because they have no neighbors:

const layer1 = comp.filter((n) => graph.outDegree(n) !== 0);
const layer2 = comp.filter((n) => graph.inDegree(n) !== 0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants