Skip to content

Conversation

@sadrasabouri
Copy link
Collaborator

Reference Issues/PRs

What does this implement/fix? Explain your changes.

This PR adds new engine which generates random labeled tree using Prufer sequence method.

Any other comments?

I double-checked the generated examples from examples from here to make sure the correct implementation. I added a refinement at the end of the generation algorithm to make the edge_dict sorted and incremental, when i is connected to j edge_dict[i] has j if i < j.

@sadrasabouri sadrasabouri self-assigned this Dec 27, 2025
@sadrasabouri sadrasabouri added this to the pyrgg v2.1 milestone Dec 27, 2025
@sadrasabouri sadrasabouri marked this pull request as ready for review December 27, 2025 11:21
README.md Outdated
</tr>
</table>

### Labeled Tree Generator (using Prüfer sequence)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this text is too long for a section title. I suggest removing the "using Prufer sequence".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point; fixed in 2125b09.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants