function delete_cvrp(filepath)
    rm(filepath)
end

function write_cvrp(cvrp::CVRPLIB.CVRP)

    if cvrp.name == ""
        name = randstring(10)
    else 
        name = cvrp.name 
    end

    filepath = joinpath(pwd(), name * ".vrp")

    if cvrp.dummy > cvrp.depot # dummy is added
        org_weights = cvrp.weights[1:end-1, 1:end-1]
    else
        org_weights = cvrp.weights
    end

    open(filepath, "w") do io
        write(io, "NAME : $(name)\n")
        write(io, "COMMENT : Generated by BranchPriceCutCVRP.jl\n")
        write(io, "TYPE : CVRP\n")
        write(io, "DIMENSION : $(cvrp.dimension)\n")
        write(io, "EDGE_WEIGHT_TYPE : $(cvrp.weight_type)\n")
        write(io, "CAPACITY : $(cvrp.capacity)\n")
        if cvrp.distance < Inf 
            write(io, "DISTANCE : $(cvrp.distance)\n");
        end
        if cvrp.service_time > 0.0  
            write(io, "SERVICE_TIME : $(cvrp.service_time)\n");
        end

        if cvrp.weight_type == "EXPLICIT"
            @assert length(cvrp.coordinates) == 0

            write(io, "EDGE_WEIGHT_FORMAT : FULL_MATRIX\n")
            write(io, "DISPLAY_DATA_TYPE : NO_DISPLAY\n")
            write(io, "EDGE_WEIGHT_SECTION\n")
            writedlm(io, org_weights)

            # write(io, "EDGE_WEIGHT_FORMAT : LOWER_ROW\n")
            # write(io, "DISPLAY_DATA_TYPE : NO_DISPLAY\n")
            # write(io, "EDGE_WEIGHT_SECTION\n")
            # for i in 2:cvrp.dimension
            #     for j in 1:i-1
            #         write(io, "\t$(org_weights[i,j])")
            #     end
            # end
            # write(io, "\n")

        else
            write(io, "NODE_COORD_SECTION\n")
            x = cvrp.coordinates[:, 1]
            y = cvrp.coordinates[:, 2]
            for i in 1:cvrp.dimension
                write(io, "$i $(x[i]) $(y[i])\n")
            end
        end
        write(io, "DEMAND_SECTION\n")
        for i in 1:cvrp.dimension
            write(io, "$i $(cvrp.demand[i])\n")
        end
        write(io, "DEPOT_SECTION\n")
        write(io, "$(cvrp.depot)\n")
        write(io, "-1\n")
        write(io, "EOF\n")
    end

    return name, filepath
end