Shortest paths from adjacency matrix

I am working on a project in which I am creating an adjacency matrix of cities and need to find and print out up to 3 of the shortest paths based on time or cost between two cities. I am struggling in figuring out what the easiest way to do this is. I am supposed to use a priority queue to store the shortest paths. If anyone has an ideas or can show me how to do this that would be great. Thanks.

import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.Scanner;
import java.util.LinkedList;

class Destination{
    String name;
    double cost;
    double time;
    
    public String getName(){
        return name;
    }
}
class City{
    String name;
    LinkedList<Destination> reachableCities = new LinkedList<>();
    
    public void addReachableCity(String destinationName, double cost, double time){
        boolean duplicate = false;
        for(Destination element : reachableCities){
            if(element.getName().equals(destinationName)){
                duplicate = true;
            }
        }
        
        if(duplicate == false){
            Destination destination = new Destination();
            destination.name = destinationName;
            destination.cost = cost;
            destination.time = time;

            reachableCities.add(destination);
        }
    }
    
    public String getName(){
        return name;
    }
    
    public LinkedList<Destination> getDestinations(){
        return reachableCities;
    }
}

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter flight data input file: ");
        String flightData = scanner.nextLine();
        LinkedList<City> cities = createList(flightData);
        
        System.out.println("Enter requested flight plans input file: ");
        String requestdFlights = scanner.nextLine();
        
        printList(cities);
    }
    
    public static void findPaths(LinkedList<City> cities, String fileName){
        int numLines = 0;
        String line;
        String startCity = "";
        String destinationCity = "";
        String timeOrCost = "";
        try{
            Scanner scanner = new Scanner(file);
            numLines = Integer.parseInt(scanner.nextLine());
            for(int i = 0; i < numLines; i++){
                line = scanner.nextLine();
                int pipedCounter = 0;
                for(int j = 0; j < line.length(); j++){
                    if(pipedCounter == 0 && line.charAt(j) != '|'){
                        startCity += line.charAt(j);
                    }
                    else if(pipedCounter == 1 && line.charAt(j) != '|'){
                        destinationCity += line.charAt(j);
                    }
                    else if(pipedCounter == 2 && line.charAt(j) != '|'){
                        timeOrCost += line.charAt(j);
                    }
                    else{
                        pipedCounter++;
                    }
                }
                
                if(timeOrCost.equals("T")){
                    for(City element : cities){
                        if(element.equals(startCity)){
                            findPathTimes(element, destinationCity);
                        }
                    }
                }
            }
        }
    }
    
    public static void findPathTimes(City element, String destinationCity){
        //
    }
    public static void printList(LinkedList<City> list){
        for(City element : list){
            LinkedList<Destination> destinations = element.getDestinations();
            System.out.println(element.getName());
            for(Destination destination: destinations){
                System.out.println(destination.getName());
            }
            System.out.println();
        }
    }
    
    public static LinkedList<City> createList(String fileName) {
        String line;
        String cityName = "";
        String destinationName = "";
        String cost = "";
        String time = "";
        int numLines = 0;
        LinkedList<City> cities = new LinkedList<>();
        File file = new File(fileName);
        try {
            Scanner scanner = new Scanner(file);
            numLines = Integer.parseInt(scanner.nextLine());
            for(int i = 0; i < numLines; i++){
                line = scanner.nextLine();
                int pipedCounter = 0;
                for(int j = 0; j < line.length(); j++){
                    if(pipedCounter == 0 && line.charAt(j) != '|'){
                        cityName += line.charAt(j);
                    }
                    else if(pipedCounter == 1 && line.charAt(j) != '|'){
                        destinationName += line.charAt(j);
                    }
                    else if(pipedCounter == 2 && line.charAt(j) != '|'){
                        cost += line.charAt(j);
                    }
                    else if(pipedCounter == 3 && line.charAt(j) != '|'){
                        time += line.charAt(j);
                    }
                    else{
                        pipedCounter++;
                    }
                }
                
                boolean duplicate = false;
                for(City element : cities){
                    if(element.getName().equals(cityName)){
                        duplicate = true;
                        element.addReachableCity(destinationName, Double.parseDouble(cost), Double.parseDouble(time));
                    }
                }
                
                if(duplicate == false){
                    City city = new City();
                    city.name = cityName;
                    city.addReachableCity(destinationName, Double.parseDouble(cost), Double.parseDouble(time));
                    cities.add(city);
                }
                
                duplicate = false;
                for(City element : cities){
                    if(element.getName().equals(destinationName)){
                        duplicate = true;
                        element.addReachableCity(cityName, Double.parseDouble(cost), Double.parseDouble(time));
                    }
                }
                
                if(duplicate == false){
                    City destination = new City();
                    destination.name = destinationName;
                    destination.addReachableCity(cityName, Double.parseDouble(cost), Double.parseDouble(time));
                    cities.add(destination);
                }
                    
                cityName = "";
                destinationName = "";
                cost = "";
                time = "";
            }
        } catch (FileNotFoundException e) {
            System.err.println("File not found: " + fileName);
            return null;
        }
        return cities;
    }
}

Honestly, I created the adjacency matrix and have been lost since. I have looked into breadth first search to find the shortest path but I am struggling with how to implement it.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật