Bike Trail Diﬃculty Rating in the South Moravian Region Modelled Using Fuzzy Sets

The fuzzy sets are more suitable for modelling of the vagueness than the classical crisp sets. They present vague phenomenon and relations which are not exactly bounded but they are associated with their verbal expression. Inaccuracies of characteristics of the bike trail diﬃculty are connected to the area changes and it is necessary to evaluate and update them regularly. The analysis is solved by the compositional rule of inference methods especially by Mamdani’s and Larsen’s method. The diﬃculty is the result of rules processing with verbal variables for the type of road and slope. The suitability of methods is tested by certiﬁed and categorized parts of the bike trails. The modelling has been performed by rasters using software ArcGIS 10.1 and its geoprocessing tools.


Introduction
The term "fuzzy" is used in meaning of wispy, unclear, misty, vague, uncertain [1].Although we can describe the phenomenon exactly and clearly, we often utilize unclear, unconfined terms in usual life.We apply terms as moderate slope, near the road.We speak about "linguistic variables" (slope, road) which assume linguistic values (moderate, near) [2].We sometimes modify linguistic terms by adding expressions called hedges, for example very moderate slope, slightly near the road.
We are able to model real situations better using fuzzy sets, sets with unclear boundary.Each element is in the set more or less.It is indicated by a degree of membership to a fuzzy set expressed by value between zero and one.
Fuzzy sets are perceived as generalization of classical crisp sets which are their special case.Quality "to be fuzzy" is often expressed as ambiguity, not as inaccuracy or uncertainty, it is relative and subjective.
Look at the definition of fuzzy set using the characteristic function.Let X be a universe set (crisp set).A fuzzy set A of the universe X is defined by a characteristic function called membership function µ A such that µ A : X → 0, 1 where µ A (x) is the Kolisko, P.: Bike Trail Difficulty Rating in the South Moravian Region . . .

membership value of x in A.
The membership value assigns a degree of membership to a fuzzy set to any element.µ A (x) = 1 element x belongs to a fuzzy set for sure µ A (x) = 0 element x doesn t belong to a fuzzy set for sure 0 < µ A (x) < 1 we aren t sure if element x belongs to a fuzzy set.
Each function X → 0, 1 determines any fuzzy set definitely.
We can understand the fuzzy set as the complete universe, but only some elements are not definitely in it.The membership degree to the fuzzy set is specified by mathematical function [3].
We usually compose the membership functions of elementary linear functions.These are trapezoidal, triangular, S-shaped and L-shaped membership functions.We often use more complicated rounded functions, too -Gaussian function, bell-shaped function, sinusoidal function etc.

Operations on fuzzy sets and fuzzy logic
We can define operations complement, union and intersection on fuzzy sets in similar way as on crisp sets.
The standard intersection of two fuzzy sets A and B is a fuzzy set with the membership function defined by µ A∩B (x) = min (µ A (x) , µ B (x)).

Zadeh s intersection
The standard union of two fuzzy sets A and B is a fuzzy set with the membership function defined by The standard complement of fuzzy set A is a fuzzy set with the membership function defined by Functions for modelling fuzzy conjunction are called triangular norms (t-norms), for fuzzy disjunction triangular conorms (t-conorms).They are assumed as functions of two variables defined on a unit square [4].

Fundamental t-norms
Łukasiewicz t-norm The drastic t-norm is the smallest t-norm and the minimum t-norm is the largest t-norm, because we have Kolisko, P.: Bike Trail Difficulty Rating in the South Moravian Region . . .

Fundamental t-conorms
The maximum t-conorm S M is the smallest t-conorm, drastic t-conorm is the largest t-conorm, because we have S D (x, y) ≥ S L (x, y) ≥ S P (x, y) ≥ S M (x, y).

Now we can generalize expression of fuzzy sets union and intersection.
The intersection of fuzzy sets based on t-norm T is the fuzzy set with the membership function defined by The union of fuzzy sets based on t-conorm T is the fuzzy set with the membership function defined by Therefore, the standard intersection and union are special cases Similarly, the fuzzy negation, the complement of the fuzzy set and various implications are defined.[5].

Fuzzy relations
Let X, Y be crisp sets.A binary fuzzy relation R from X to Y is any fuzzy subset R of the set X × Y. Fuzzy relation R is described by the membership function µ R : X × Y → 0, 1 .
We can define intersection on t-norm T and union on t-conorm S.

Definition of composition of fuzzy relations
Let X, Y, Z be crisp sets, A, B binary fuzzy relations and T t-norm.Then sup-T composition of fuzzy relations A and B is fuzzy relation

Fuzzy inference and generalized modus ponens
The fuzzy inference is a process which is applied to reasoning based on vague concept.The inductive method modus tollens and the deductive method modus ponens are the basic rules of inference in binary logic.In modus ponens we infer validity of a propositional formula q from validity of implication p ⇒ q and validity of premise of a propositional formula p.

Generalized modus ponens
In fuzzy reasoning we use a generalized modus ponens (Tab. 1) according to following statement, where A, B, A , B are fuzzy sets, X, Y linguistic variables.The scheme consists of a rule or a premise (prerequisite), an observing and a conclusion (consequence).The table (Tab. 1) compare generalized modus ponens to the basic deduction modus ponens.
Comparison of modus ponens method against generalized modus ponens p q p ⇒ q 1 1 1 1 0 0 0 1 1 0 0 1 modus ponens generalized modus ponens p ⇒ q p ⇒ q p p q q The observing does not have to correspond to the premise in the rule.According to finding degree of comparison between premise X is A in the rule and current observing X is A it happens modification conclusion Y is B in the rule and getting value B of variable Y .If it is A = A in observing, it have to be valid B = B.The fact is, we operate more rules, input and output variables.

Example:
Rule if the slope is moderate, the bike trail difficulty is easy Observing slope is steeper Conclusion bike trail difficulty is harder

Compositional Rule of Inference
Practically we need to interpret verbal values of sets A, B mathematically and define the rule of fuzzy relation R between variables X, Y .We use the compositional rule of inference for assignment value B of variable Y , which corresponds with value A of variable X.
We can get term, where the set B is the sup-min composition of the fuzzy set A and the fuzzy relation R, written as B = A • R with the membership [6] compositional rule of inference on t-norm T
We have to keep generalized modus ponens during relational reasoning, too, i.e.
The fuzzy relations can be modelled by a logical implication or by a cartesian product T * based on t-norm.We confine to the second possibility and we get We can generalize the properties to t-norm T .
If we choose T = T * = T M we get Mamdani's method.
For T = T M and T * = T P , it is Larsen's method [7].

Mamdani's method
Let s have a look at Mamdani's method in detail [8].
Let B = {P 1 , P 2 , . . ., P k } be a knowledge base with k rules for n input variables X 1 , X 2 , . . ., X n and one output variable Y .Each of the variables X i have the verbal value A i,j in j-th rule, variable Y has the verbal value B j , where i = 1, 2, . . ., n, j = 1, 2, . . ., k.For Mamdani's regulator are defined: Because the effort with the whole of the relation is numerically arduous, it is preferable to use the approach FITA (first inference then aggregation), which means reasoning of conclusion rule-by-rule, where the final aggregate conclusion is , where w j = min (w 1j , w 2j , . . ., w nj ) is the total weight of j-th rule, numbers w 1j , w 2j , . . ., w nj are particular degrees of fulfilment of the premises in j-th rule We can generalize the properties to t-norm T .
Consider the generalisation of t-norm T for an intersection and t-norm T * for an assignment of the relation (Fig. 1).The membership function for degrees w j = T (w 1j , w 2j , . . ., w nj ) is For Larsen's method is written T = T M and T * = T P .
Figure 1: Illustrative scheme of the universal regulator with two rules, two input variables and one output variable

Defuzzification
If we apply crisp inputs, the results of inference are fuzzy outputs.We often need to find the particular real value of output by defuzzification.There are several methods to defuzzify for miscellaneous usage (Fig. 2).We can distribute them to methods searching the most acceptable solution and methods of the best compromise [9].
The situation is simpler, if the universe of the output variable is discrete subset of real numbers Y = {y 1 , y 2 , . . ., y r }.
(y) dy continuous membership function discrete membership function CoS [3] It serves to find the first coordinate of the centroid of area which is bounded by the function defined as sum of the membership functions µ B j .The method is easy-to-use because it does Kolisko, P.: Bike Trail Difficulty Rating in the South Moravian Region . . .not need to determine the conclusion B .If the particular conclusions of rules do not overlap, the result of the method CoS is the same as for the method CoG.
continuous membership function discrete membership function

CoM
The first coordinate of the membership function is written for each conclusion of rule by the method of the most important maximum (Mean of Maximum) and the result is the centroid of singletons.

The application of fuzzy methods in solution of bike trail difficulty rating
Bike trail difficulty is the basic characteristic to recognize during the cycle route planning.It gives us to qualify whether the route is suitable for families with children, for recreational sportsmen, maybe for athletes.In 2003 and 2005 projects were made with intent to collect information about cycle routes and their facilities.In 2007 the data were updated by terrain research -especially the status of surface and difficulty (demandingness) of bike trail.
The data are published on the web cycling portal of the South Moravian Region http: //www.cyklo-jizni-morava.cz, including the interactive bike trail map with choosing routes and view points of interest.
During actual checking well-known routes it was verified that the characteristic of bike trail difficulty has already completely disagreed with the reality.Each rating depends on time, it is affected by the subjective view and data collection is a hard task in terrain.
Therefore, we need to utilize another approach for instance by fuzzy reasoning.The slope and the quality or type of the road surface, which were chosen as analytical inputs, impact on the difficulty.
The modelling is accomplished over rasters in ArcGIS 10.1 using ModelBuilder and geoprocessing tools, especially Spatial Analyst Tools -Fuzzy Membership, Fuzzy Overlay, Raster Calculator, Cell Statistics.

Methods
We use two input variables, X 1 for the type of the road surface and X 2 for the angle of the slope (both defined by crisp values) and output variable Y for the bike trail difficulty.
Assume the following input and output fuzzy subsets which are given by verbal values and rules representing their relationship.
Type of road surface (data StreetNet 2012) The fuzzy sets K 1 , K 2 , K 3 were given by the bell-shaped membership function Near (Midpoint 0, Spread 0,0001) available in the geoprocessing tools of ArcMap in the category Fuzzy Membership (Fig. 3).The function expresses the close localization of the road as a fuzzy line [10] in network of roads.The tool Kernel Density was selected at first.It more highlighted density of roads to the chosen area.But the results were not satisfactory because they characterised roads inaccurately as fuzzy lines in regions with small density of roads.
We will use and compare several regulators and defuzzification methods.We will do the interpretation rule-by-rule.We declare w j as the total weight of the j-th rule worked from particular weights of premises (roads, slope) w 1j , w 2j .The membership function of conclusion of the j-th rule is written µ D j (y).This is summary and specification of applied methods.

Mamdani's method (COS-TM-TM)
Considering evaluation of the road surface and reasoning of conclusion rule-by-rule, we will choose (COS-TM-TM) the centroid of sums which means calculation.
The total weight of the j-th rule w j is the minimum of the particular weights of the premises (roads, slope) w 1j , w 2j in this rule (simply signed w).The membership function of the conclusion of the j-th rule is presented as µ D j (y) = min w j , µ D j (y) .The membership µ D j (y) is simply denoted µ (y).
The model in ArcGIS ModelBulder is shown in Fig. 9.
In the first and the second rule we evaluate small difficulty D 1 (Fig. 6).
Geoinformatics FCE CTU 11, 2013 In the third and the fourth rule we evaluate intermediate difficulty D 2 (Fig. 7).
In the fifth and the sixth rule we evaluate hard difficulty D 3 (Fig. 8).

Mamdani's method (COM-TM-TM)
We evaluate by the centroid of singletons Center of Maximum (COM-TM-TM) using the mean of the maximum.
By substituting values:

Comparison of defuzzification methods CoS and CoM
The raster analysis result is in range between 1,085 and 4,916 for CoS method, between 0,501 and 5,500 for CoM method.In ArcMap we see that the results are comparable.The value difference of both processes CoM-CoS gives results from -0,564 to 0,626.
Negative values of the difference are related to the flat land and the closeness to the paved and maintained roads (CoS>CoM), CoM gives the less difficulty of the roads.Positive values are related to the steep slope and the closeness to the forest and the cart roads (CoS<CoM), CoM gives the bigger difficulty of the roads.The numerically simpler and less accurate method CoM without the integral calculus gives similar view to data but with bigger interval range depending on the relief and the road.
Analogous to Mamdani's method we will process other methods where we will choose CoS defuzzification, too.

Comparison of all used methods
The data of well-known parts of the bike trails which were possible to classify in predominant distance were selected to choose the best method.
Following tables (Tab.2, Tab. 3 and Tab.4) show the comparison of the maximum, minimum, arithmetic mean and standard deviation according to the difficulty of the bike trails.Then we monitored frequency histograms.
From these fundamental characteristics and also matching histograms (they are not in this paper) we can see that Mamdani's method is well representative with defuzzification CoS but also with defuzzification CoM, where there is the bigger value range and the higher frequency on the intervals of the maximum occurrence.
Larsen's method and its modifications with the product t-norm of the degrees of the premises have similar characteristics.However, they are not suitable for the bike trails with the intermediate difficulty because they have the maximum frequency for the maximum and the Geoinformatics FCE CTU 11, 2013 Kolisko, P.: Bike Trail Difficulty Rating in the South Moravian Region . . .It still will be interesting to compare the percentage of the bike trails suitable for the membership in intervals 0, 25; 1 , 0, 5; 1 and 0, 75; 1 according to the functions D 1 , D 2 , D 3 (small, intermediate and hard difficulty) in regard of their whole choice for the individual difficulties and the methods (Tab.5, Tab.6 and Tab. 7).
The sum value of the percentages expresses the precision of the individual method.We can see that Mamdani's method bluntly dominates, especially with defuzzification CoS respectively in the larger membership.The results of Larsen method are quite good.This method is The most important three methods are compared at the selected region (Fig. 10).
We choose the bike trail difficulty obtained by Mamdani's method with the defuzzification CoS for another analytical processing.This method increases practical applicability for all roads.It will permit to reclassify the attribute of the current bike difficulty and to add the difficulty of the other roads for the routing as the finding optimal road according to the difficulty.
We also can get roads and transform them to the points by the extract from the fuzzy raster.
The points provide the precise assessment of the behaviour of the road difficulty depending on the raster quality and they are classified by smaller or bigger value of the degree of the difficulty in the following figure (Fig. 11).

Conclusion
The bike trail difficulty is the important data for the planning the cycle trips.Mainly, it depends on the quality of the surface road and the slope.We can express the requests to the bike trail fairly verbally by rules that are processed using the fuzzy sets based on the compositional rule of inference and Mamdani's method.This method has reached the best effect with the defuzzification the centroid of sums and using the integral calculus.
The main aim of this paper is the exploitation and map presentation of the results on the web cycling portal of the South Moravian Region http://www.cyklo-jizni-morava.cz/.The analysis extends the difficulty of the bike trails to all roads.Considering fuzzy approach we can imagine the region compactly as a whole of the seamless bike trail difficulty raster fuzzy map and as the bike trail difficulty point fuzzy map.The reclassification of the current difficulty and update of the road difficulty network for the routing is important to the improvement of routing depending on required target group (family with children, recreational sportsman or athlete).
The methods of the most acceptable solution are presented by the methods of the most important maximum with selection of the biggest value of the membership functions placed leftmost, middlemost or rightmost -Left of Maximum (LoM), Mean of Maximum (MoM), Right of Maximum (RoM).Methods of the best compromise include:Center of Gravity (CoG) -the centroid of area (the centroid of the plane figure given by union of the part areas bounded by particular membership functions).Geoinformatics FCE CTU 11, 2013 Kolisko, P.: Bike Trail Difficulty Rating in the South Moravian Region . . .Center of Sums (CoS) -the centroid of sums (the centroid of the plane figure given by function, which is equal to the sum of the particular membership functions in the rules) Center of Maximum (CoM) -the centroid of singletons (the centroid of the typical values, e.g.MoM, for the particular membership functions of the rules).Method Bisector of Area (BoA) divides the area of the plane figure into two sub-regions of the equal area.

Figure 6 :Figure 7 :
Figure 6: Membership function for small difficulty

Figure 8 :
Figure 8: Membership function for hard difficulty

Figure 10 :
Figure 10: Comparison of the methods in the region detail

Table 2 :
Bike trails classified as small difficulty roads minimum and highlight the bike trail with the small and hard difficulty.The methods going from Łukasiewicz t-norm with other t-norms still more emphasize these extremes.The result does not almost depend on the choice of these methods.

Table 5 :
Part of suitable bike trails for membership 0, 25; 1 not much reliable in the evaluation of the intermediate difficult bike trails.It significantly competes with Mamdani's method within the small and hard difficult bike trails.Other methods are not much satisfactory.