-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathvisual_graphs.rb
More file actions
37 lines (28 loc) · 1.08 KB
/
visual_graphs.rb
File metadata and controls
37 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true
require_relative "visual_graphs/version"
require_relative "visual_graphs/graph"
require_relative 'visual_graphs/algorithms/Kruskal'
require_relative 'visual_graphs/adjacency_matrix_graph'
module VisualGraphs
class Error < StandardError; end
class InvalidJSONFileNameError < RuntimeError; end
class IncorrectArgumentsForGraphInit < StandardError; end
# error for wrong parameters in weighted graph initialization
class WrongParamsForWeightedGraphInit < StandardError; end
# error which occurs in case of accessing non-existent files
class FileDoesNotExist < StandardError; end
# errors connected with defining of adjacency matrix
class AdjacencyMatrixError < StandardError
def initialize(msg = '', exception_type = '')
@exception_type = exception_type
super(msg)
end
end
# errors connected with inappropriate changes to an adjacency matrix
class InappropriateChangeOfAdjacencyMatrix < StandardError
def initialize(msg = '', exception_type = '')
@exception_type = exception_type
super(msg)
end
end
end