Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Test whether a Tree has a path that is within one edge of every vertex
Every vertex of this tree is within one edge of a spine path from vertex 1 to vertex 8:
In[1]:= | ![]() |
Out[1]= | ![]() |
Here vertex 10 is not within one edge of the spine path:
In[2]:= | ![]() |
Out[2]= | ![]() |
CaterpillarTreeQ also supports graphs:
In[3]:= | ![]() |
Out[3]= | ![]() |
Non-tree graphs are not caterpillar trees:
In[4]:= | ![]() |
Out[4]= | ![]() |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License