New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route_schedule: Improve ranked pairs implementation #1366

Merged
merged 2 commits into from Jan 15, 2016

Conversation

Projects
None yet
2 participants
@TeXitoi
Copy link
Member

TeXitoi commented Jan 14, 2016

http://jira.canaltp.fr/browse/NAVITIAII-1988

Bench for RER and Transilien on fr-idf (kraken only):

Line removed topo before time before topo after time after
A 1314 149644 24.1 19601 6.0
B 692 105984 14.1 9939 2.4
C 364 99623 11.8 5308 1.5
D 1453 94221 10.3 21426 4.8
E 677 77381 8.5 9570 1.8
H 1849 98187 10.8 28425 4.8
J 712 107003 13.5 11383 2.3
K 0 1 0.0 1 0.0
L 159 179827 33.0 2555 1.0
N 47 57244 4.2 672 0.2
P 46 27357 1.9 638 0.1
R 36 6653 0.2 405 0.0
U 0 1 0.0 1 0.0

nb edges = topo before - 2 (except when topo before = 1)

tldr: always faster, really faster on L

@TeXitoi

This comment has been minimized.

Copy link
Member

TeXitoi commented Jan 14, 2016

@l-vincent-l small improvement of the thermometer heuristic!

@TeXitoi TeXitoi force-pushed the TeXitoi:improve-ranked-pairs-implementation branch 2 times, most recently from ad2cf37 to c6744c1 Jan 14, 2016

if (e_descrs.size() < nb_elt_to_add) {
// add corresponding edges
while (nb_elt_to_add != e_descrs.size()) {
const size_t idx = done_until + e_descrs.size();

This comment has been minimized.

@antoine-de

antoine-de Jan 15, 2016

Contributor

I find that writing it with a for loop is easier to understand (but maybe only for me 😉 ):

for(const auto idx = done_until; idx < done_until + nb_elt_to_add; ++ idx) no ?

This comment has been minimized.

@TeXitoi

TeXitoi Jan 15, 2016

Member

I think the comment is addressed.

void Thermometer::generate_thermometer(const std::vector<vector_idx> &stop_point_lists) {
void Thermometer::generate_thermometer(const std::vector<vector_idx> &sps) {
std::vector<vector_idx> stop_point_lists = sps;
boost::range::sort(stop_point_lists, [](const vector_idx& a, const vector_idx&b) { return a.size() > b.size(); });

This comment has been minimized.

@antoine-de

antoine-de Jan 15, 2016

Contributor

I think it's worth it to add a comment explaining why we do this.

@TeXitoi TeXitoi force-pushed the TeXitoi:improve-ranked-pairs-implementation branch 2 times, most recently from 8e1e864 to e2fb1fd Jan 15, 2016

antoine-de added a commit that referenced this pull request Jan 15, 2016

Merge pull request #1366 from TeXitoi/improve-ranked-pairs-implementa…
…tion

route_schedule: Improve ranked pairs implementation

@antoine-de antoine-de merged commit 0f6371d into CanalTP:dev Jan 15, 2016

1 check passed

default Build finished. 944 tests run, 0 skipped, 1 failed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment