Function Repository Resource:

# AlternatingTreeGraph

Construct an alternating tree graph

Contributed by: Peter Burbery
 ResourceFunction["AlternatingTreeGraph"][n] generates an alternating tree graph from a path graph with n vertices.

## Details

An alternating tree J is a tree each of whose edges joins an inner vertex to an outer vertex so that each inner vertex of J meets exactly two edges of J.
An alternating tree graph has 3n-4 vertices.
ResourceFunction["AlternatingTreeGraph"] takes the same options as Graph.

## Examples

### Basic Examples (1)

Make an alternating tree graph from the path graph with 10 vertices:

 In[1]:=
 Out[1]=

### Scope (1)

Create a large alternating tree graph:

 In[2]:=
 Out[2]=

### Options (2)

#### GraphLayout (2)

All graph layouts can be selected:

 In[3]:=
 Out[3]=

Try SpringEmbedding if SpringElectricalEmbedding does not work well:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=

### Applications (1)

Find the graph center and graph periphery:

 In[6]:=
 Out[6]=
 In[7]:=
 Out[7]=

### Properties and Relations (2)

Use FindSequenceFunction to find a pattern in the order and size of the graph:

 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=

Predict the size of a 2980 length alternating tree:

 In[11]:=
 Out[11]=
 In[12]:=
 Out[12]=
 In[13]:=
 Out[13]=

Peter Burbery

## Requirements

Wolfram Language 12.3 (May 2021) or above

## Version History

• 1.0.1 – 13 July 2023
• 1.0.0 – 02 August 2022