two-hub

Which airports of MX have no direct flight to MEX, yet would still reach it in two flights if any one hub closed?

22 OF 22 CHANGE THE ANSWER

Deletion-minimal: no single remaining relationship can be removed without changing the answer. It does not mean smallest possible.

The answer

airporthub_countries
PBC['MX', 'US']
QRO['MX', 'US']
TLC['MX', 'US']
UPN['MX', 'US']

Exhibits (22 relationships)

#fromtypeto
1ACAHAS_ROUTEMEX
2ACAIN_COUNTRYMX
3DFWHAS_ROUTEMEX
4DFWIN_COUNTRYUS
5LASHAS_ROUTEMEX
6LASIN_COUNTRYUS
7LAXHAS_ROUTEMEX
8LAXIN_COUNTRYUS
9PBCHAS_ROUTEDFW
10PBCHAS_ROUTETIJ
11PBCIN_COUNTRYMX
12QROHAS_ROUTEDFW
13QROHAS_ROUTETIJ
14QROIN_COUNTRYMX
15TIJHAS_ROUTEMEX
16TIJIN_COUNTRYMX
17TLCHAS_ROUTEACA
18TLCHAS_ROUTELAS
19TLCIN_COUNTRYMX
20UPNHAS_ROUTELAX
21UPNHAS_ROUTETIJ
22UPNIN_COUNTRYMX

The witness graph

12345678910111213141516171819202122ACADFWLASLAXMEXMXPBCQROTIJTLCUPNUS
query
MATCH (a:Airport)-[:IN_COUNTRY]->(:Country {code: $country}) WHERE a.iata <> $dest AND NOT EXISTS { MATCH (a)-[:HAS_ROUTE]->(:Airport {iata: $dest}) } MATCH (a)-[:HAS_ROUTE]->(hub:Airport)-[:HAS_ROUTE]->(:Airport {iata: $dest}) OPTIONAL MATCH (hub)-[:IN_COUNTRY]->(hc:Country) WITH a, count(DISTINCT hub) AS hubs, coll.sort(collect(DISTINCT hc.code)) AS hub_countries WHERE hubs >= 2 RETURN a.iata AS airport, hub_countries ORDER BY airport
params
{"country": "MX", "dest": "MEX"}
source
air-routes.rl · 3,748 nodes · 57,645 relationships
source sha256
b124cf2c6b3af3075cec11125b0355523ca2817210adfcfe1ac3aa4a650e6734
reduction
371 trials · 0 inconclusive · 1.095 s
check
22 of 22 change the answer (22 of 22 relationships, 0 of 0 isolated nodes) · relate CLI: sufficiency + 22 of 22 necessity probes cross-checked
versions
Witness 0.1.0 · relate-db 1.0.1