Path - Path class
use Graph::Path qw(:all);
Path class provides the following methods:
new, AddVertex, AddVertices, Copy, GetCommonVertices, GetEdges, GetEndVertex, GetLength, GetStartVertex, GetTerminalVertices, GetVertex, GetVertices, IsCycle, IsIndependentCyclicPath, IsIndependentPath, IsPath, Join, JoinAtVertex, PopVertex, PushVertex, PushVertices, Reverse, ShiftVertex, StringifyPath, UnshiftVertex, UnshiftVertices
Path is a sequential list of vertices with an edge between two successive vertices. The path becomes a cycle when start vertex and end vertex are the same.
The following operators are overloaded:
Using specified VertexIDs, new method creates a new Path object and returns newly created Path object.
Adds VertexID to Path and returns Path.
Adds vertices using VertexIDs to Path and returns Graph.
Copies Path and its associated data using Storable::dclone and returns a new Path object.
Returns an array containing common vertex IDs between two paths. In scalar context, number of common vertices is returned.
Returns an array containg successive paris of vertex IDs corresponding to all edges in Path. In scalar context, the number of edges is returned.
Returns VertexID of end vertex in Path.
Returns Length of Path corresponding to number of vertices in Path.
Returns VertexID of start vertex in Path.
Returns vertex IDs of start and end vertices in Path.
Returns specific vertex ID from Path corresponding to Index with indicies starting from 0.
Returns an array containing all vertex IDs in Path. In scalar context, number of vertices is returned.
Returns 1 or 0 based on whether Path is a CyclicPath which has the same start and end vertex IDs.
Returns 1 or 0 based on whether Path is an independent CyclicPath. For a Path to be an independent cyclic path, it must be a cyclic path and have unique vertices.
Returns 1 or 0 based on whether Path is an independent Path. For a Path to be an independent path, it must have unique vertices.
Returns 1 or 0 based on whether Object is a Path object
Joins existing Path with a new path specified as a OtherPath object or an array of VertexIDs and returns NewPath.
In order to successfully join two paths, terminal vertices must have a common vertex. Based on the common terminal vertex found, additional path vertices are added to the current Path in one of the following four ways:
Joins existing Path with OtherPath at a specified CeterVertexID and returns a NewPath.
Removes end vertex from Path and returns Path.
Adds VertexID to Path after end vertex and returns Path.
Adds VertexIDs to Path after end vertex and returns Path.
Reverses order of vertices in Path and returns Path.
Removes start vertex from Path and returns Path.
Returns a string containing information about Path object.
Adds VertexID to Path before start vertex and returns Path.
Adds VertexIDs to Path before start vertex and returns Path.
Copyright (C) 2019 Manish Sud. All rights reserved.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.