Skip to content

Releases: IvanTulaev/graph-by-ivan-tulaev

1.0.0-alpha.2

Choose a tag to compare

@IvanTulaev IvanTulaev released this 26 Mar 21:41

Some updates

  • add exports for types and util functions
  • update vite

1.0.0-alpha.1

Choose a tag to compare

@IvanTulaev IvanTulaev released this 10 Mar 16:44

1.0.0-alpha.1

Description

  • Working with direction graphs.
  • Has utility functions for elements CRUD operations (nodes & edges)
  • Customise graph traversing with genericTraversing
  • Get independent sub-graphs with getSeparatedGraphs
  • Check if there is a path between two nodes in different directions with isNodeTraced
  • Has some popular functions for customisation traversing in traversingFunctions

Traverse customisation

Use genericTraversing in Graph class for create your own graph traversing algorithm.

callbacks

  • getStartElement: (visited: Set, initialGraph: Graph) => N | undefined
    • get node to start or repeat iteration after executionSequence is empty
    • stop iteration when undefined
  • getNextFromExecutionSequence: (executionSequence: Array) => N | undefined
    • get next elements from executionSequence
    • in some cases it is best way to use .pop()... in some cases .shift()
  • getNextNodes: (node: N, graph: Graph, visited: Set) => Array | undefined
    • for get next nodes
    • these can be outgoing, incoming or other specific nodes
    • stop iteration when undefined
  • addNextNodesToExecutionSequence: (nodes: Array, executionSequence: Array) => void
    • add nodes to executionSequence
    • in some cases it is best way to use .push()... in some cases .unshift()
  • executeCurrent?: (node: N) => void
    • for current node processing

examples

For callbacks examples you can check getSeparatedGraphs() and isNodeTraced() in Graph class

0.0.8

Choose a tag to compare

@IvanTulaev IvanTulaev released this 07 Mar 20:50
Merge branch 'master-1'

# Conflicts:
#	package-lock.json
#	tsconfig.json
#	vite.config.ts