Really need help here. I am building an app in react-native that shows which bus to catch after choosing starting station and ending station.
I have a list of bus data with its routes(stations). In JSON format to be precise.
It really gets hard when it comes to finding the best pathway to get to the ending station. In which station to drop and change the bus. So many possibilities.
An example:
"11100060": {
"end_time_at_start_point": "21:56",
"station_list": [
{
"station_name": "65-р дэлгүүр",
"station_id": "000000067",
"longitude": 106.79329,
"station_seq": 1,
"exist_bus": "N",
"latitude": 47.92013
},
{
"station_name": "Толгойт Шөнийн дэлгүүр",
"station_id": "000000069",
"longitude": 106.7881,
"station_seq": 2,
"exist_bus": "Y",
"latitude": 47.91983
},
{
"station_name": "ТОЛГОЙТЫН ЭЦЭС",
"station_id": "000000071",
"longitude": 106.78174,
"station_seq": 3,
"exist_bus": "N",
"latitude": 47.91878
},
{
"station_name": "Цэргийн хотхон",
"station_id": "000000072",
"longitude": 106.7824,
"station_seq": 4,
"exist_bus": "N",
"latitude": 47.91277
},
{
"station_name": "Нефть хотхон",
"station_id": "000000024",
"longitude": 106.78749,
"station_seq": 5,
"exist_bus": "N",
"latitude": 47.91047
},
{
"station_name": "10 буудал",
"station_id": "000000022",
"longitude": 106.79976,
"station_seq": 6,
"exist_bus": "Y",
"latitude": 47.90955
},
{
"station_name": "5 Шар",
"station_id": "000000020",
"longitude": 106.81484,
"station_seq": 7,
"exist_bus": "N",
"latitude": 47.90965
},
{
"station_name": "Монгол хюндэй киа компани",
"station_id": "000000018",
"longitude": 106.82659,
"station_seq": 8,
"exist_bus": "N",
"latitude": 47.91061
},
{
"station_name": "32-р байр",
"station_id": "000000011",
"longitude": 106.83359,
"station_seq": 9,
"exist_bus": "N",
"latitude": 47.91113
},
{
"station_name": "Хар хорин",
"station_id": "000000009",
"longitude": 106.84054,
"station_seq": 10,
"exist_bus": "N",
"latitude": 47.91166
},
{
"station_name": "Цамбагарав",
"station_id": "000000006",
"longitude": 106.84736,
"station_seq": 11,
"exist_bus": "N",
"latitude": 47.9122
},
{
"station_name": "Саппоро",
"station_id": "000000004",
"longitude": 106.85283,
"station_seq": 12,
"exist_bus": "N",
"latitude": 47.91256
},
{
"station_name": "3-р эмнэлэг",
"station_id": "000000147",
"longitude": 106.86022,
"station_seq": 13,
"exist_bus": "N",
"latitude": 47.91305
},
{
"station_name": "10-р хороолол",
"station_id": "000000149",
"longitude": 106.86824,
"station_seq": 14,
"exist_bus": "Y",
"latitude": 47.91361
},
{
"station_name": "25-р Эмийн сан",
"station_id": "000000151",
"longitude": 106.87949,
"station_seq": 15,
"exist_bus": "N",
"latitude": 47.91437
},
{
"station_name": "Богд ар хороолол",
"station_id": "000001403",
"longitude": 106.88384,
"station_seq": 16,
"exist_bus": "N",
"latitude": 47.91128
},
{
"station_name": "Вокзал",
"station_id": "000000671",
"longitude": 106.8851,
"station_seq": 17,
"exist_bus": "N",
"latitude": 47.90904
},
{
"station_name": "Барс худалдааны төв",
"station_id": "000000180",
"longitude": 106.89058,
"station_seq": 18,
"exist_bus": "Y",
"latitude": 47.90896
},
{
"station_name": "Монгол эм импекс",
"station_id": "000001408",
"longitude": 106.90107,
"station_seq": 19,
"exist_bus": "Y",
"latitude": 47.90843
},
{
"station_name": "Жигүүр гранд",
"station_id": "000000284",
"longitude": 106.90996,
"station_seq": 20,
"exist_bus": "Y",
"latitude": 47.90814
},
{
"station_name": "Соёлж худалдааны төв",
"station_id": "000000312",
"longitude": 106.92907,
"station_seq": 21,
"exist_bus": "N",
"latitude": 47.90809
},
{
"station_name": "Говь хангай",
"station_id": "000001409",
"longitude": 106.9388,
"station_seq": 22,
"exist_bus": "Y",
"latitude": 47.90795
},
{
"station_name": "Нарантуул зах",
"station_id": "000000408",
"longitude": 106.95281,
"station_seq": 23,
"exist_bus": "Y",
"latitude": 47.90782
},
{
"station_name": "Ахмадын хороолол",
"station_id": "000000410",
"longitude": 106.96013,
"station_seq": 24,
"exist_bus": "N",
"latitude": 47.90784
},
{
"station_name": "БЗД 13-р хороо",
"station_id": "000000411",
"longitude": 106.96828,
"station_seq": 25,
"exist_bus": "N",
"latitude": 47.90771
},
{
"station_name": "Номин худалдааны төв",
"station_id": "000001161",
"longitude": 106.97534,
"station_seq": 26,
"exist_bus": "N",
"latitude": 47.91058
},
{
"station_name": "Чулуун овоо",
"station_id": "000000381",
"longitude": 106.98419,
"station_seq": 27,
"exist_bus": "Y",
"latitude": 47.91229
},
{
"station_name": "Шөнийн дэлгүүр",
"station_id": "000000383",
"longitude": 106.98935,
"station_seq": 28,
"exist_bus": "Y",
"latitude": 47.91256
},
{
"station_name": "Хууль сахиулах их сургууль",
"station_id": "000000385",
"longitude": 106.99747,
"station_seq": 29,
"exist_bus": "N",
"latitude": 47.91299
},
{
"station_name": "Ботаник",
"station_id": "000000579",
"longitude": 107.00088,
"station_seq": 30,
"exist_bus": "N",
"latitude": 47.91286
}
],
"result_code": "001",
"line_name": "Ч:6 (65-р дэлгүүр-Ботаник)",
"line_id": "11100060",
"weekday_interval": 3,
"start_time_at_end_point": "06:25",
"holiday_interval": 5,
"start_time_at_start_point": "06:30",
"line_type": "",
"end_time_at_end_point": "23:11"
},