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

Visualize for skip list #64

Closed
aveldan opened this issue Jul 5, 2024 · 3 comments
Closed

Visualize for skip list #64

aveldan opened this issue Jul 5, 2024 · 3 comments
Assignees
Labels
visualization Related to visualization issues

Comments

@aveldan
Copy link
Contributor

aveldan commented Jul 5, 2024

Hey @spirosmaggioros I was trying to create a visualize for skip list. I saw it was missing it.
I had a little bit of success but I am not sure how do I make the edges for same key nodes in different level to be perfectly vertical.

Below is the result from my trying.
Screenshot from 2024-07-05 16-43-59

You see the 0 from all different levels should be ideally vertical.
This is the dot file for the above image

digraph list {
rankdir=LR;
node [shape=record;]
k0l2 [label="{<f0> 0 | <f1> } | <f2> "];
k12l2 [label="{<f0> 12 | <f1> } | <f2> "];
k0l2:f1 -> k12l2:f0;
k0l1 [label="{<f0> 0 | <f1> } | <f2> "];
k0l2:f2 -> k0l1:f0;
k6l1 [label="{<f0> 6 | <f1> } | <f2> "];
k0l1:f1 -> k6l1:f0;
k12l1 [label="{<f0> 12 | <f1> } | <f2> "];
k6l1:f1 -> k12l1:f0;
k12l2:f2 -> k12l1:f0;
k0l0 [label="{<f0> 0 | <f1> } | <f2> "];
k0l1:f2 -> k0l0:f0 [rankdir=TB];
k3l0 [label="{<f0> 3 | <f1> } | <f2> "];
k0l0:f1 -> k3l0:f0;
k6l0 [label="{<f0> 6 | <f1> } | <f2> "];
k3l0:f1 -> k6l0:f0;
k6l1:f2 -> k6l0:f0;
k7l0 [label="{<f0> 7 | <f1> } | <f2> "];
k6l0:f1 -> k7l0:f0;
k9l0 [label="{<f0> 9 | <f1> } | <f2> "];
k7l0:f1 -> k9l0:f0;
k12l0 [label="{<f0> 12 | <f1> } | <f2> "];
k9l0:f1 -> k12l0:f0;
k12l1:f2 -> k12l0:f0;
}

Here in the dot file I am naming the nodes as k<key>l<level> so k6l0 [label="{<f0> 6 | <f1> } | <f2> "]; means node with key 6 in 0th level.

I have tried adding something like [rankdir=TB] in front of relevant edges.
Also tried something like

subgraph cluster_0 {
        rankdir=TB;
        00:f2 -> 00:f0;
    }

But they don't work.
You have any idea how to make it happen help me. I am not very much familiar with the dot file structure.

Copy link

github-actions bot commented Jul 5, 2024

Thank you for your interest in AlgoPlus, a maintainer will see your issue soon!

@spirosmaggioros
Copy link
Member

You can look here: https://skiplist.readthedocs.io/en/latest/visualisations.html . I had in mind to make one, but i wanted to implement more stuff to just check the boxes, and when everything is ready look into the visualizations and examples. If you can make it work will be great.

@spirosmaggioros
Copy link
Member

This is closed as @aveldan made it.

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

No branches or pull requests

2 participants