Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Szeged index of an undirected graph or a molecule
ResourceFunction["SzegedIndex"][g] computes the Szeged index of the graph g. | |
ResourceFunction["SzegedIndex"][mol] computes the Szeged index of the molecule mol. |
The Szeged index of a Petersen graph:
In[1]:= |
Out[1]= |
Compute the Szeged index of a molecule:
In[2]:= |
Out[2]= |
Compute the Szeged index of a named entity:
In[3]:= |
Out[3]= |
By default, hydrogens are ignored in the computation of the Szeged index:
In[4]:= |
Out[4]= |
Use IncludeHydrogens→All to account for hydrogens:
In[5]:= |
Out[5]= |
Generate all alkanes with 7 carbon atoms (heptanes) using the resource function AlkaneIsomers:
In[6]:= |
Out[6]= |
Sort the heptane isomers by their Szeged index. This effectively sorts them from "most branched" to "least branched":
In[7]:= |
Out[7]= |
Define a function for computing the Wiener index of a graph:
In[8]:= |
For an acyclic graph, the Szeged index is equivalent to the Wiener index:
In[9]:= |
Out[10]= |
The Szeged index is equal to half the sum of all elements of the Szeged matrix:
In[11]:= |
Out[12]= |
Wolfram Language 12.3 (May 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License