Syntax
ELi=ELselect(EL,i)
Input Parameter
EL : | | Edge list |
i : | | vertex index |
Output Parameter
ELi : | | Edge list from index. ELi(:,1) is always i |
Copyright 2014-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, ELselect
, is designed to filter an edge list based on a specified vertex index. It returns all edges that start or end with the given vertex index.
Input Parameters
- EL: The edge list, which is a matrix where each row represents an edge with two columns indicating the start and end vertices.
- i: The vertex index, a single integer, used to filter the edges in the edge list.
Output
- ELi: A filtered edge list where each edge is associated with the vertex index
i
. The first column of ELi
is always i
.
Algorithm Explanation
- The function first identifies all edges in the edge list
EL
where the first vertex is equal to the specified index i
. This is done using the condition EL(:,1)==i
.
- It then identifies all edges where the second vertex is equal to
i
. For these edges, the order of vertices is reversed to maintain consistency, ensuring that i
is always the first vertex. This is achieved with [EL((EL(:,2)==i),[2 1])]
.
- The two sets of edges are concatenated vertically to form a single matrix.
- The resulting matrix is sorted using
sortrows
to ensure a consistent order of edges.
- The final sorted matrix is returned as
ELi
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:25. (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