Skip to content

Conversation

@jakoschiko
Copy link
Owner

First attempt to provide a generator for tree-like structures.

@jakoschiko
Copy link
Owner Author

Here some stats for the max depth of generated trees with 100k nodes.

Branching:

dice::weighted_one_of_die().three(
    (16, dice::just(1)),
    (4, dice::just(2.min(max_branch_count))),
    (1, dice::uni_usize(1..=max_branch_count)),
)

Result:

The test withstood 10000 passes.

# Config
- seed: 13442140669564993173
- start limit: 0
- end limit: 100
- passes: 10000

# Stats
- max depth:
	- 15.51% (1551): ~110
	- 14.95% (1495): ~100
	- 11.71% (1171): ~120
	- 11.33% (1133): ~90
	- 9.39% (939): ~80
	- 7.92% (792): ~70
	- 6.83% (683): ~130
	- 6.79% (679): ~60
	- 4.61% (461): ~50
	- 3.40% (340): ~140
	- 2.81% (281): ~40
	- 1.44% (144): ~150
	- 1.34% (134): ~30
	- 0.75% (75): ~20
	- 0.50% (50): ~10
	- 0.35% (35): ~160
	- 0.21% (21): ~170
	- 0.13% (13): ~0
	- 0.02% (2): ~190
	- 0.01% (1): ~200

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

Successfully merging this pull request may close these issues.

2 participants