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

Consider ways to model edge string fragments in database schema #28

Open
learner-long-life opened this issue Jul 2, 2024 · 1 comment
Assignees

Comments

@learner-long-life
Copy link
Contributor

In modeling this input string and suffix tree with the visualizer

image

We notice that edge strings have repeating fragments, and it may be easier to extend the end fragment with new characters (bc in the example above for all the leaves)

One possible way to

model Node {
  id          Int    @id @default(autoincrement())
  parentId    Int
  childId     Int
  stringStart Int 
  stringEnd   Int
}

model InputString {
  id          Int    @id @default(autoincrement())
  inputString String
}

model Node {
  id          Int    @id @default(autoincrement())
  parentId    Int
  childId     Int
  edgeString EdgeStringFragment[]
}

model NodeToEdgeStringFragments {
  
}

model EdgeStringFragment {
  id          Int    @id @default(autoincrement())
  stringFragment String
}

model InputString {
  id          Int    @id @default(autoincrement())
  inputString String
}

Or store input start and end indices

model Node {
  id          Int    @id @default(autoincrement())
  parentId    Int
  childId     Int
  edgeStringStart Int
  edgeStringEnd Int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants