treeNodesofEL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - EL/Edge Lists
Introduced first in SolidGeometry 3.8, Creation date: 2017-04-06, Last change: 2025-09-14

returns the tree structure from a given edge list

Description

Function removes lines with Nan first: In a list there are:
- single used points (Terminals)
- doubled used points (Links)
- three or more times used points (Branches)


See Also: CELofEL

Example Illustration

 missing image of treeNodesofEL(EL)

Syntax

[vi,vc,bi,ti,li]=treeNodesofEL(EL)

Input Parameter

EL: Edge list

Output Parameter

vi: list of vertices [vi n]
vc: vertes use counter [bi ti li]
bi: branch index
ti: terminal index
li: link index

Examples


A=SGbox([30,20,10]); EL=FEofSG(A); treeNodesofEL(EL)




Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, treeNodesofEL, processes an edge list (EL) to determine the structure of a graph in terms of its vertices and their connections. It categorizes vertices into branches, terminals, and links based on their usage frequency.

Input Parameters

Output Results

Algorithm Steps

  1. Remove any NaN values from the edge list using the helper function woNaN.
  2. Identify unique vertices from the cleaned edge list and initialize a count column for each vertex.
  3. If there are no vertices, return empty arrays for all outputs.
  4. Flatten the edge list to a single column vector el containing all vertex indices.
  5. For each unique vertex, count its occurrences in el and store this count in the second column of vi.
  6. Determine the type of each vertex based on its usage count:
    • Branches: vertices used more than twice.
    • Terminals: vertices used exactly once.
    • Links: vertices used exactly twice.
  7. Create a logical matrix vc to classify each vertex as a branch, terminal, or link.
  8. Find indices of branch, terminal, and link vertices in vi and store them in bi, ti, and li respectively.
Algorithm explaination created using ChatGPT on 2025-08-19 06:46. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21