Bsoft 2.1.4
Bernard's software package
model_path.h File Reference

Library routines used for model processing. More...

#include "rwmodel.h"
#include "Matrix.h"
#include "Bstring.h"

Functions

Matrix model_shortest_path (Bmodel *model)
 Calculates the shortest path between every pair of vertices. More...
 
double model_wiener_index (Bmodel *model)
 Calculates the Wiener index. More...
 
Bmodelmodel_hamiltonian_cycle (Bmodel *model)
 Calculates the Hamiltonian cycles in a model. More...
 

Detailed Description

Library routines used for model processing.

Author
Bernard Heymann
Date
Created: 20060908
Modified: 20150208

Function Documentation

◆ model_hamiltonian_cycle()

Bmodel * model_hamiltonian_cycle ( Bmodel model)

Calculates the Hamiltonian cycles in a model.

Parameters
*modelmodel structure.
Returns
Bmodel* linked list of models with cycle links.
A Hamiltonian cycle passes through each component once.
The cycles are limited to the links in the input model.
Redundant cycles are discarded.
Only the first model in the linked list is used.
Each of the resultant models has links forming a Hamiltonian cycle.
Reference: H. Wiener, J. Am. Chem. Soc., 1947, 69, 17.

◆ model_shortest_path()

Matrix model_shortest_path ( Bmodel model)

Calculates the shortest path between every pair of vertices.

Parameters
*modelmodel structure.
Returns
Matrix path matrix.
The adjacency matrix is calculated as a starting point.
Only the first model in the linked list is used.

◆ model_wiener_index()

double model_wiener_index ( Bmodel model)

Calculates the Wiener index.

Parameters
*modelmodel structure.
Returns
double average Wiener index.
The Wiener index is calculated as the sum of the elements of
the shortest path matrix.
Only the first model in the linked list is used.
Reference: H. Wiener, J. Am. Chem. Soc., 1947, 69, 17.