Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Hosoya Z index of a graph
ResourceFunction["HosoyaZ"][g] computes the Hosoya index of the graph g. |
The Hosoya index of a Petersen graph:
| In[1]:= |
| Out[1]= |
Get the same result from GraphData:
| In[2]:= |
| Out[2]= |
Compute the Hosoya index of a molecule:
| In[3]:= | ![]() |
| Out[3]= |
Compute the Hosoya index of a named entity:
| In[4]:= |
| Out[4]= |
By default, hydrogens are ignored in the computation of the Hosoya index:
| In[5]:= |
| Out[5]= |
Use IncludeHydrogens→All to account for hydrogens:
| In[6]:= |
| Out[6]= |
Computing the Hosoya index becomes slow even at a modest number of graph edges:
| In[7]:= |
| Out[7]= |
| In[8]:= |
| Out[8]= | ![]() |
Generate the first few straight-chain alkanes:
| In[9]:= |
| Out[9]= | ![]() |
The Hosoya indices of the straight chain alkanes can be expressed as Fibonacci numbers:
| In[10]:= |
| Out[10]= |
| In[11]:= |
| Out[11]= |
Generate the first few cycloalkanes:
| In[12]:= |
| Out[12]= | ![]() |
The Hosoya indices of the cycloalkanes can be expressed as Lucas numbers:
| In[13]:= |
| Out[13]= |
| In[14]:= |
| Out[14]= |
Wolfram Language 12.3 (May 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License