#graph #process #trace-logging #heuristics #tree #traversal #object

graph_process_manager_loggers

Generic loggers for graph_process_manager_core

15 releases

0.1.14 Jun 4, 2023
0.1.13 Jun 3, 2023
0.1.12 May 31, 2023
0.1.3 Apr 27, 2023

#609 in Algorithms

Download history 7/week @ 2024-02-21 6/week @ 2024-02-28 4/week @ 2024-03-06 36/week @ 2024-03-13

53 downloads per month
Used in autour_process

Apache-2.0

205KB
2K SLoC

Generic loggers for graph_process_manager_core

4 types of loggers to log processes implemented/tooled with graph_process_manager_core :

  • a GraphViz logger to produce graphical representations of the processes
  • a nodesPrint logger to print in files intermediate objects build during the process
  • a stepsTrace logger to print in files traces i.e. sequences of steps taken during the process
  • a NFAIT logger to build a Non Deterministic Finite Automaton (with Immediate Transitions)

Trivial example uses are given in the test module. We shortly describe them in the following.

Fibonacci sequence

In this example, we explore the Fibonacci sequence. A maximum depth is set to 10 for this example.

Applying a simple GraphViz logger to this example process gives the following representation:

GraphViz log of Fibonacci process

The following Automata can be build from this exploration :

NFAIT of Fibonacci process

A nodesPrint logger is used here to print the numbers in the Fibonacci sequence in text files and a stepsTrace logger is used to print the sequence of 'next' steps (here it is a trivial application but for other processes there may be various kinds of steps etc.).

Below is represented the files generated by the two loggers for the example toy process: files generated by the 2 loggers

Binary Tree

In this example we explore words built incrementally from 'O' by appending letters 'A' and 'B' to the right. For the exploration we set a maximum depth of 4 and a maximum number of nodes (words) of 8.

Depending on the heuristic we use for the exploration, we do not reach the same set of words.

Using a BFS (Breadth First Search) we get the following:

BFS

Using a DFS (Depth First Search) we get the following:

DFS

Using a HCS (High Coverage Search, which favors branches with the least common prefixes) we get the following:

HCS

Explorations can be further specialized using more detailed filters and priorities for the selection of the next steps to take. Randomization of the next steps to take is also possible.

Dependencies

~3.5MB
~63K SLoC