kytos-ng / pathfinder

Kytos main path finder Network Application (NApp)
https://kytos-ng.github.io/api/pathfinder.html
MIT License
0 stars 7 forks source link

[Fix] `undesired_links` and `desired_links` #28

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

Fixes #20 #27

I've explored it locally with the same topology that Italo has initially reported the issue and same request, here's a diff of the response:

❯ diff /tmp/resp_master.json /tmp/resp_fix.json
11,30d10
<         "00:00:00:00:00:00:00:02:3",
<         "00:00:00:00:00:00:00:03:2",
<         "00:00:00:00:00:00:00:03",
<         "00:00:00:00:00:00:00:03:4",
<         "00:00:00:00:00:00:00:06:5",
<         "00:00:00:00:00:00:00:06",
<         "00:00:00:00:00:00:00:06:2",
<         "00:00:00:00:00:00:00:05:3",
<         "00:00:00:00:00:00:00:05",
<         "00:00:00:00:00:00:00:05:1"
<       ]
<     },
<     {
<       "cost": 14,
<       "hops": [
<         "00:00:00:00:00:00:00:01:1",
<         "00:00:00:00:00:00:00:01",
<         "00:00:00:00:00:00:00:01:2",
<         "00:00:00:00:00:00:00:02:2",
<         "00:00:00:00:00:00:00:02",
❯ rg "00:00:00:00:00:00:00:01:3|00:00:00:00:00:00:00:06:3|00:00:00:00:00:00:00:05:3|00:00:00:00:00:00:00:06:2" /tmp/resp_master.json
17:        "00:00:00:00:00:00:00:06:2",
18:        "00:00:00:00:00:00:00:05:3",
❯ rg "00:00:00:00:00:00:00:01:3|00:00:00:00:00:00:00:06:3|00:00:00:00:00:00:00:05:3|00:00:00:00:00:00:00:06:2" /tmp/resp_fix.json

I've also re-run the same example of issue #27, no longer duplicated paths are being seeing in the response.

viniarck commented 1 year ago

Closing this in favor of PR #30, took the chance to also cover another requirement in that one.