Skip to content

simple & collapsed subgraphs in one function #183

Closed

Description

@yakra

Yet another idea that could yield substantial time savings in graph generation:

  • Combine simple & collapsed subgraph generation into a single function.
  • Call a modified matching_vertices only once, collecting a list of all matching vertices, both hidden and visible.
    • We'll need to keep track of the number of visible vertices as we go.
  • Iterate thru vertices, writing:
    • all of them to the simple graph
    • only the visible ones to the collapsed graph
  • In HighwayGraphVertexInfo, we'll need separate vertex_num variables for simple & visible vertices.

Activity

  1. self-assigned this
    on Feb 3, 2019
  2. yakra commented on Feb 4, 2019

    @yakra
    ContributorAuthor

    C++ progress:
    Running all graphs thru tmg2html via a shell script, I got 13 segmentation faults.
    There are 26 country graphs, 13 simple + 13 collapsed.

  3. yakra commented on Feb 4, 2019

    @yakra
    ContributorAuthor

    Only coincidence. All collapsed graph are hosed. Segfaults in 5 of 7 categories.

  4. yakra commented on Feb 4, 2019

    @yakra
    ContributorAuthor

    Fixed.
    I forgot to update the variable written by HighwayGraphCollapsedEdgeInfo::collapsed_tmg_line, and experienced the same symptom as here.
    I'll figure out the stats in the morning.

  5. yakra commented on Feb 4, 2019

    @yakra
    ContributorAuthor

    C++ on BiggaTomato:

    task before after time
    ratio
    % speed
    increase
    Creating area data graphs 46.2 37.2 0.805 24.2
    Creating regional data graphs 229.6 164.7 0.717 39.4
    Creating system data graphs 4.9 3.7 0.755 32.4
    Creating multisystem graphs 10.1 6.6 0.653 53.0
    Creating multiregion graphs 6.9 4.6 0.667 50.0
    Creating country graphs 45.4 29.4 0.648 54.4
    Creating continent graphs 56.0 36.0 0.643 55.6
    TOTAL: 399.1 282.2 0.707 41.4

    Shaved off another 1:57.
    Now to implement this in Python.

  6. yakra commented on Feb 4, 2019

    @yakra
    ContributorAuthor

    Python on noreaster

    Compared to the version in #182:

    task before* after time
    ratio
    % speed
    increase
    Creating area data graphs 223.4 171.1 0.766 30.6
    Creating regional data graphs 188.6 142.9 0.758 32.0
    Creating system data graphs 5.7 5.0 0.877 14.0
    Creating multisystem graphs 8.1 6.4 0.790 26.6
    Creating multiregion graphs 5.4 4.2 0.778 28.6
    Creating country graphs 32.6 24.3 0.745 34.2
    Creating continent graphs 38.8 28.4 0.732 36.6
    TOTAL: 502.6 382.3 0.761 31.5

    *these figures match the data in this table and not these, because I'm using an updated HighwayData repo.

    Saves just over 2 minutes in all.


    Compared to 791e6be:

    task before* after time
    ratio
    % speed
    increase
    Creating area data graphs 447.2 171.1 0.383 161.4
    Creating regional data graphs 724.6 142.9 0.197 407.1
    Creating system data graphs 13.3 5.0 0.376 166.0
    Creating multisystem graphs 16.9 6.4 0.379 164.1
    Creating multiregion graphs 14.2 4.2 0.296 238.1
    Creating country graphs 73.5 24.3 0.331 202.5
    Creating continent graphs 78.8 28.4 0.360 177.5
    TOTAL: 1368.5 382.3 0.279 258.0

    *these figures don't match the data in previous tables, because I'm using an updated HighwayData repo.

    Saving 16:26.2! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions