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

Linking backend implemented using disjointed sets #10

Open
loolmeh opened this issue Feb 17, 2015 · 0 comments
Open

Linking backend implemented using disjointed sets #10

loolmeh opened this issue Feb 17, 2015 · 0 comments

Comments

@loolmeh
Copy link
Owner

loolmeh commented Feb 17, 2015

sketch:

  • schema:
    • components table:
      • sentence_id: the exact sent, fk
    • component_id: representative sentence_id of the disjointed set, chosen by min(sentence_id) in the disjointed set
  • operations:
    • link:
    • find the two disjointed sets using sent's component_id
    • concat both sets into one set
    • find minimum id in set, update both disjointed sets to have this id
    • unlink:
    • find the disjointed set
    • remove this id from the set
    • find the minimum id in set, update disjointed set, removed sentence becomes its own set, with component_id same as its own id
    • find:
    • simple select on component_id column
    • get_subgraph:
      • find which set a sent_id is in and get it
    • feed the nodes to the graphing code and calculate all distances
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

1 participant