Open aiAdrian opened 6 months ago
Thank you Adrian for the document, we will soon have a closer look at this feature and see how we can work from it !
Please take a look at the feature (Analytics enabled / not yet well implemented) where the current version calculates the shortest path and uses the current network graphic for visualization.
The concept behind this online real-time analytics is to calculate the travel times from a specific node of interest to all other nodes in real-time. When the mouse pointer hovers over the "clock," the corresponding sector representing a 1-minute interval gets highlighted. If the user clicks on a sector, all paths are visualized. The visualized paths represent the shortest path taken to "implement" the travel chain, with the departure time at the node of interest set to the selected minute. Only the colors in the nodes are important, so the clocks are visualized with near-transparent opacity. If no sector/minute is selected, the colors in the nodes and the paths are not relevant, meaning the user can manipulate the network graphic normally, and the clocks will always adjust accordingly.
The business information behind this concept is that there is a passenger or goods ready to be transported at a specific node at a given time. Thus, the displayed travel chain (travel time) is the effective travel time for a passenger. The clock for #changes (Umsteigen) and #travel time (Reisezeit) gives a very quick overview of how well the concept is balanced.
Required interactions:
Discussion: Meeting 03.07.2024
Commitment We agree that the Origin-Destination Matrix should be developed in small steps. We agree that it is currently very difficult to estimate how quickly the matrix can be calculated. Since each entry is a shortest path and the necessary information needs to be extracted for each of these paths, the computation time can potentially be very long. To get a sense of how quickly the many Dijkstra shortest paths can be calculated, we want to first develop or test the matrix as a pure CSV (comma-separated value) export.
Here's what we will do:
Ajdustment / Next steps
Once the exported information is ready, we will verify and cross-check it with the business (owner) users.
After finalizing the data and incorporating the feedback, we can proceed to build the UI integration. This involves designing and developing the user interface (UI) and user experience (UX) based on the insights and learnings gained from the CSV exports.
The implementation phase will follow the UI design. This involves translating the design into functional code and integrating it into the existing system. The implementation should align with the specifications and goals defined during the CSV export and UI/UX design phases.
Throughout the process, it is essential to maintain effective communication and collaboration with the business users to ensure their needs are met and any changes or adjustments are addressed in a timely manner.
Thank you for the debriefing, we indeed agree on your above comment.
First, we will search for an algorithm (if there is!) that enable the computation of some nodes to some nodes only, to allow taking in account the filtering, otherwise we might stick to Dijkstra. We thought on a way to reduce computational complexity : re-use the calculations on sections already computed.
We still have a few questions:
[!NOTE]
For implementation: do not forget to take in account the minimal connection time (of a node) when trying to compute shortest path
Test Scenario: The data and all lines are fictional, but having a medium-sized test network graphic is valuable:
Medium Test_Scenario.json
Small Test_Scenario_2.json
Small Test_Scenario_3.json
Participants: Adrian, Jules, Louis, Maëlys, Stéphane
Travel time (including connections) + number of connections * penalty (fixed) per connection
(penalty could be minimal connection time of the node + 5min
or minimal connection time of the node * 2
i.e.About the algos: just wanted to mention Floyd–Warshall is an option in theory, but it may be too slow for many vertices (1000+, sparse graph).
For the graph model: each "inner" vertex will likely be a (node, "arrival" or "departure", time) tuple, each edge being derived from trainrun sections (departure, arrival) or connections/transitions (arrival, departure), including connection cost if suitable. The algos may run more easily if we generate a departure and arrival "outer" vertex as well for each node (the expected output being shortest paths from departure to arrival outer vertices), connected to the "inner" vertices at this node (likely costing 0). Memory may or may not be an issue, it may help to implicitly generate the graph (mostly if running dijkstra).
Author: @shenriotpro
POC with input Scenario medium
3 -> 113 = 109
and 113 -> 3 = 110
)A filter has been implemented to select the nodes that we want for the output (but still search in all nodes)
A few notes:
Fixed a few bugs, there are a few ways to optimize, but the performance got worse:
I am trying to write down the feature for the User Interface part
I have several questions:
- "in the Streckengrafik, the used path is highlighted" (cf. above picture, path is in green/red), any more informations ?
Note that the used path is currently not computed (it should not be too hard though).
- considering the above comments, a lot of features needs to dynamically change the matrix, if opened ; do we still consider running O/D matrix calculations on any change ? which might slow the application
This is outside my expertise, but it could possibly be updated on a regular basis (when the user is inactive?) or on a separate worker.
https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/issues/199
Early experiment: Done with Version 2.9.1
Preflight Checklist
Request type
Request for a new component
Functionality
The Origin/Destination Analysis enables the analysis of travel times and connections in the network graph (timetable). In principle, the fastest connections are sought starting from a start node. In order to limit or penalize the number of transfers, the timetable planner has the option to penalize transfer connections with additional time. This allows the costs for transfers to be controlled and determines whether a travel chain may include more or fewer transfer operations. The feature should implement the following functions/requirements:
Embedded in a dialog
The origin/destination matrix is opened in a dialog window, similar to the trainrun dialog. The dialog box is centered in the window and can be toggled to full screen if requested by the user. Toggling the full screen mode off will reset it to the initial size. The dialog window can be freely moved. The dialog window can be closed, by clicking in the upper right corner. In the menu bar there will be a button to open/close the dialog window. The origin/destination matrix should be possible to open in the editor and in the Streckengrafik (time distance graph).
Design - proposals (TBD) for the matrix:
Variant 1: Travel time and number of transfer operations (symetric)
Variant 2: Number of transfer operations focused
Variant 3: Separate number of transfer operations and travel time
Variant 4: Number of transfer operations focused
Filtering
Connectivty
Interactivity
E.g. BN to ZF
Search
Cell: Enter from / to Node shortname - will reduce the matrix dimension. Either no node is specified (full matrix), or only from / to (filtered matrix) or both (just one path).
UI Prototype
Editor
Streckengrafik
(The times, ... in the example are not correct, just a Mockup.)
Real-time feedback Once a path is selected in the origin/destination matrix, editing of the Netzgrafik is locked, which means no changes can be made. If no path is selected, any changes made in the Netzgrafik will result in an update of the matrix. It might be necessary to calculate it in a separate thread to ensure high responsiveness, but this needs to be tested during implementation.
Changing the filter immediately triggers an update.
If a path was selected and changing the filter causes the path to disappear (no longer feasible), it will result in the deselection of the path. However, if the previously selected path remains visible after changing the filter, it will remain selected as it was. The same behavior applies if the user deletes a trainrun and the path is no longer found or feasible. In such cases, the path will be deselected.
Open questions The CVS export button is missing, and the position for the input field and button has not been fixed yet. The transfer penalty must also be insertable.
Which design variant is the most readable and best fit? It needs to be determined.
Dependancy
https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend/issues/77