# Exploring the Food Pairing Hypothesis in Saudi Cuisine Using Genetic Algorithm

Authors: Muna Al-Razgan; Shahad Tallab; Taha Alfakih
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

Computational gastronomy has emerged as one of the recent hot research topics in the field of food science. It is a field that studies food in the era of data. One of the current research topics in this field is the food pairing hypothesis, which states that food with common flavor compounds tastes good when consumed together. The hypothesis has been studied in Western and European gastronomic societies. However, there are no reported studies conducted in Arab counterparts. In this study, we used genetic algorithms (GAs) to validate this hypothesis in Saudi cuisine. We developed a quantitative model and applied it to a dataset consisting of ingredients compounds found in Saudi cuisine recipes. Our research revealed that the pattern of ingredients occurring in Saudi dishes showed positive food pairing results like western cuisine. Moreover, our research directs the light to new dimensions where GA can be applied to explore the field of food science and computational gastronomy.


---

## Body

## 1. Introduction

The French gastronome Jean Anthelme Brillat-Savarin once said in 1826 “Tell me what you eat, and I’ll tell you who you are [1].” Cuisine is a vital part of any culture. It reveals many characteristics about the people who belong to it and facts related to where they live, what types of crops their land grows, and what their climate is like. World’s cuisine differs from each other in the ingredients, that is, use and the preparation style that is adopted in cooking. Throughout history, food preparation has been carried out through trial and error. Scientists also adopted this experimental method when they studied the chemical makeup of food to understand more about the ingredients and their interactions. With the help of computer technology, the field of food science was able to mature to the point of rapidly growing into a quantitative research field [2].One of the most prominent quantitative research in food science was the studies in food pairing hypothesis that received more and more attention since it was popularized in 1992 by Heston Blumenthal, the renowned chef of the famous The Fat Duck restaurant [3]. This hypothesis claims that food that shares a lot of common flavor compounds tastes delicious together. Researchers from different cultural backgrounds investigated this hypothesis in relation to their cuisine. Some cuisine like the Western cuisine showed positive pairing, meaning the ingredients used in the recipes of that cuisine tended to share more compounds of flavor. While East Asian and Indian cuisines proved quite the opposite result, ingredients with more shared compounds were less likely to occur in the same recipe [4]. Between the Western and the East Asian, this project aims at investigating whether the food pairing hypothesis in Saudi cuisine will prove positive like the Western or negative like the East Asian.Gastronomy as a term is the art or science of good eating. The latest outburst of data on food ingredients, their chemical makeup, and pairing combinations, in addition to the application of data mining, knowledge extraction techniques, and genetic algorithms, caused the emergence of a new field called “computational gastronomy,” a term coined by Ahnert in 2013 [5]. Computational gastronomy works in close proximity with data mining, which is defined as searching large amounts of data to unearth patterns and trends beyond simple analysis. Moreover, genetic algorithms played a big part in food pairing studies in the recent years, which belongs to the larger class of evolutionary algorithms [6]. Genetic algorithms are used to solve challenging problems in which the solution space is very huge. They are based on selection and evolution to produce numerous solutions for a given problem while maintaining the survival of the fittest approach in their execution [7]. In general, Algorithm 1 has the following main components [8]: initial population, consisting of a group of elements created randomly; fitness function, each element in the population is evaluated. The fitness function is problem-dependent and aims at giving the element a value based on how well it accomplishes a given task. Selection, elements are selected based on their fitness value; the higher the value, the higher the probability of being picked to produce the next generation. Parent selection varies depending on the problem. Standard genetic algorithm usually mirrors human reproduction having two parents, and sometimes, one parent is selected to pass the genetic makeup to the next generation. However, there are no limitations regarding the number of parents selected for the reproduction process [9]. Crossover: create children from elements “parents” selected from the previous step. There are many types of crossover. The most common is single-point crossover. There are two variations of the single-point crossover: mid-point crossover, where the chromosomes of the parents are split in the middle point, and random-point crossover, where the breaking point of the chromosome is randomly selected. The child will take one part of the chromosome of parent 1 and the second part from parent 2. Mutation: the children are mutated randomly to guarantee that the children are not all exactly the same. Mutation introduces diversity to the initial generation through the evolutionary process. The probability of mutation is typically between 1 and 2 tenths of a percent. The mutation process continues until an optimal solution is found or a number of generations have been reached [8].Algorithm 1: Basic genetic algorithm
Initial populationFitness FunctionREPEATSelectionMid-Point crossover//if the chromosomes of the parents are split in the middleRandom-point crossover//if the breaking point of the chromosome is randomly selectedMutationCompute fitnessUNTIL population has convergedEndUsing data mining techniques and genetic algorithms on data in food science have the potential to expand the understanding of food choices and the cultural diversity of world’s cuisines. The world’s cuisines comprise many cuisines such as the European cuisine, the North American cuisine, the Latin American cuisine, the Asian cuisine, and the Arab cuisine. Arab cuisine in general differs from the rest of the cuisines in observing religious restrictions. As Islam is a major religion, its followers adhere to its teachings that forbid them from eating pork and drinking alcohol. The ethnicities of Arab cuisine are passed down from generation to generation preserving the essence of Arab cooking that revolves around the special spices and ingredients used in its preparation. There is no science behind what gives Saudi cuisine its signature savoury taste and aromatic smell. So, who is responsible for the different tastes and flavors that give each of the world’s cuisine its defining features?One answer would be the volatile chemical compounds found in food. These chemicals stimulate the nerve receptors in the nose and the mouth to create the food experience. According to Fisher in his book “Food Flavours: Biology and Chemistry,” humans are able to detect 5000 to 10000 volatile aroma compounds; however, only 2600 compounds have been recognized [9]. In 1963, Dr. C. Weurman, the Head of the Aroma Department of the “Central Institute for Food Research” at Netherlands Organization for Applied Scientific Research, instigated the gathering of volatile compounds in food [10]. The result was a huge database called the Volatile Compounds in Food (VCF) database, which has 7,647 unique flavor compounds [11]. The database has information about the volatile compounds in a particular ingredient, the range of concentrations of a compound in an ingredient, and the natural fundamental compound of a particular ingredient [10]. A few years later in 1971, a competing database was composed by Dr. Burdock, the president of the safety and regulatory consulting firm in Orlando and the internationally recognized authority on the safety of food ingredients. This database named “Fenaroli’s Handbook of Flavor Ingredients” became the standard reference for flavor ingredients throughout the world [12]. The database has 1,530 ingredients and 1,107 flavor compounds [10]. These two databases turned out to be the standard reference for ingredients’ compounds for any study related to the field of food science.The field of food science received more attention in Western research. Recently, in 1992 Chef Heston Blumenthal, the founder of The Fat Duck restaurant and the author of a cookbook with the same name, has found that caviar and white chocolate taste good together. Curious as to why this weird combination works well together, he asked the scientist François Benzi, who works for a flavoring and perfume company called Firmenich based in Geneva [13], if there was a scientific explanation as to why some food taste delicious when eaten together. They discovered that the secret lay within the chemical compounds of the flavor in the ingredients. This finding led to the birth of “the food pairing hypothesis,” which states that certain ingredients mix well together if they share similar chemical compounds [3].To deeply understand how food pairing works, it is imperative to understand some points. First, the flavor humans experience is mostly due to the sense of taste and smell, but how much each sense contributes to the whole food experience? The tongue can detect five major tastes: sweet, sour, salt, bitter, and savoury, which amounts to only 20% of the overall flavor experience. The other 80% is actually due to the aroma [9]. Hence, the aroma is essentially the vital contributor to flavor perception. Secondly, the food pairing hypothesis is significantly based on the knowledge of volatile chemical compounds of the aroma. These volatile compounds are identified using a process called gas chromatography and mass spectrometry (GC-MS) [14]. GC-MS is used in the field of chemistry to isolate chemical compounds in their gas form and measure their concentration in the sample under investigation. Applying GC-MS to food ingredients will provide a list of volatile aroma compounds out of which food scientists will select only those that will be detected by the nose. Finally, a flavor profile for each ingredient will be created based on that criteria. Chefs utilize the use of these ingredient profiles to come up with various food combinations. By using some data analysis and calculations, chefs can figure which ingredients go well with which. The more the number of shared compounds present in the ingredients, the positive the result of the pairing will be. However, Chef Blumenthal says “molecular profiling is a great tool for creativity, but it supports intuition, imagination and emotion rather than replacing them [15].”


## 2. Related Work

A proof of concept for this research based on previous research studies was first discussed in a symposium on data mining applications in 2016 [14]. Judging whether the food pairing hypothesis is true drew the interest of many researchers to investigate its validity across the diversity of world’s cuisine. A recent study [4] has built a bipartite flavor network that shows the chemical components shared by culinary ingredients (see Figure 1). The research used a huge dataset derived from Fenaroli’s Handbook of Flavor Ingredients [13]. The study showed that while Western and European cuisines are inclined toward using ingredients that share similar flavor compounds, the East Asian cuisine tended to do the exact opposite. It also emphasized that the ethnic and cultural aspects of a cuisine play a role in deciding the ingredients of a recipe rather than the actual chemistry of the ingredients.Figure 1
Bipartite flavor network from “Flavor network and the principles of food pairing” research. Borrowed from [4].A research study conducted on flavor pairing in medieval European cuisine used two datasets, one provided by Fenaroli’s Handbook of Flavor Ingredients and the other by Volatile Compounds in Food (VCF) [11]. Based on the first dataset, the research proved a positive pairing in the ingredients of medieval recipes supporting the claim of the previous study. On the other hand, when the research was tested against the second dataset, it yielded a negative pairing. Regardless of the inconclusively of the results, the authors stated that in general, the food pairing was found to be positive in European recipes. Conversely, the pairing was stronger in the medieval recipes than its counterparts of modern recipes, which was ironically due to the lack of available ingredients during that period. The study raised many questions regarding other parameters that can play a hand on the validity of the food pairing hypothesis.The latest study conducted on testing the hypothesis was published this year focusing on the Indian cuisine [16]. The authors worked to quantify the food pairing pattern and constructed models to find features that clarify the statistical properties of the cuisine. As it is a well-known fact that spices set Indian cuisine apart from other cuisines, it is not surprising that these spices play the key role in biasing food pairing toward the negative side. The study showed the significance of the spice position in a recipe to the extent when swapping one with another significantly randomizes the pairing results. The bottom line was that the higher the number of shared compounds between any two ingredients of an Indian recipe, the lower their co-occurrence probability.This study [17] proposed a capacitated model for food supply chain (FSC); this model is a constrained mixed integer nonlinear programming (MINLP) problem, which calculates the quality internally cost for a three echelon FSC, to reduce the total cost under the constraints of the total quality level, due to the nature of perishable products, and other constraints of capacity, demand, cost, and flow balance. The model used two techniques: an exact model based on the bound and branch technique and a GA solution method. In this work [18] review, the weaknesses and the relative strengths of gastronomy, chemical, and perceptual methods of dual flavors are highlighted. Then, the authors demonstrated how the various principles of pairing can be extended beyond the field of flavor-to-flavor pairing to consider the rapid growth of sonic seasoning.Deciding to go deeper in their investigation, the authors of the previous study tried to find out whether the negative food pairing pattern in Indian cuisine will hold through the eight local cuisines of India consisting of Bengali, Gujarati, Jain, Maharashtrian, Mughlai, Punjabi, Rajasthani, and South Indian cuisines [19]. Using the same investigated models of the preceding study, all the eight Indian cuisines show the same negative tendency regarding the hypothesis and that spices either separately or as a category exclusively produce that result. The authors emphasized that these spices are usually a combination of spices such as garam masala and chat masala, and are also known for the therapeutic properties.Through all these studies [4, 11, 16, 19], the researchers followed the same analytical pattern. They would first calculate the shared flavor compounds between pairs of ingredients (I, j) in recipe R:(1)NsR=Fi∩Fj,where Ns(R) represents the number shared flavor between I and j, F(i) the set with the flavor compounds found in ingredient I, and F(j) the set with the flavor compounds found in ingredient j.Then, the average of flavor sharing across the recipeR is calculated using the following formula:(2)Ns¯R=2nRnR−1∑i.jϵR.i≠jFi∩Fj,where Ns¯R represents the average shared flavor of the recipe R and nR is the number of ingredients in the recipe R; the formula is repeated for all recipes in a cuisine. Then, all the average results are summed and divided by the total number of recipes to obtain the average flavor sharing across the whole cuisine. Finally, the average flavor of the real cuisine Ns¯real needs to be compared to the average flavor sharing to a randomly constructed cuisine Ns¯rand:(3)ΔNs=Ns¯real−Ns¯rand.The result ofΔNs renders the answer to the food pairing hypothesis whether it is positive, negative, or neutral. Another study aimed at objectively testing the hypothesis without the influence of the culture or the culinary practices [20]. It was a study of the hypothesis on its basic form. Since the hypothesis states that if two food ingredients share major chemical compounds, they will provide a better eating experience when eaten together. The idea was to test whether the score of two combined ingredients was higher than the average score for the two separate ingredients. The experiment setting was as follows: a collection of seven ingredients (pear, tomato, potato, chocolate, beef, cauliflower, and anise) were tested once separately and once as a combination. The raw ingredients were cooked first and then cooled, and each of two ingredients was made into a puree. A group of fifty students evaluated each combination and gave a verdict between one to seven where one meant the taste was horrible and seven meant the taste was delicious. This sensory experiment was performed while the participants were blindfolded. To conclude the experiment, the authors highlighted a few facts. First, under normal conditions, food would not be served as cold puree with people being blindfolded. Chefs supporting the pairing theory often engage all sensory reception to heighten the eating experience. Second, the study attempted to validate the theory objectively and scientifically.All the research studies conducted on the food pairing hypothesis were conducted on real cuisines and on real recipes and ingredients. Furthermore, it is a known fact that in any research that focuses on validating a hypothesis, researchers need to formulate an appropriate null hypothesis suitable to compare with the original hypothesis. Therefore, the food pairing hypothesis researchers needed to construct random cuisines as the null hypothesis. They based their approach of building the random cuisine on a study by Osame Kinouchi titled “The Nonequilibrium Nature of Culinary Evolution [21].” This paper described recipes’ evolution as a process similar to the “founder effect” in biology. The founder effect is “a special case of genetic drift,” that happens when a small number of a population deviate from the original population and produce a new one. This new population is susceptible to the genetic drift due to inbreeding and limited gene pool, which, in turn, causes the new population to be idiosyncratically different from the parent population from which it is derived. Accordingly, the author proposes a copy-mutate algorithm to model the evolution of new cuisines as branching growth from a handful of founder recipes imitating the same founder effect concept as shown in Figure 2. Each branching node in the figure acts as a replicator (or a copy) that undergo mutation to generate a new node, and each line of node is a new resulting population. The copy-mutate model was widely used not only in studies investigating the food pairing hypothesis, but also in a study that aims at analyzing China’s cuisines similarity based on geographical distance and climate [22].Figure 2
The copy-mutate growth process relative to time (t); a randomly chosen “mother” recipe produces a mutated daughter recipe.The study followed the same methodology used in food pairing investigation to the point of building the random cuisine of China at which point the study went on to examine the similarity among regional cuisines in China in terms of temperature and physical proximity. It found that geographical closeness appears to be a key influence in the shaping of regional cuisines rather than the temperature. Based on the finding, the proposed copy-mutate model [21] showed that the results of the model agree with the empirical findings of the study. The copy-mutate model used in the previous studies is one type of genetic algorithms.On the other hand, a study argued that flavor pairing does not affect the tasting experience to a great extent and that the sequential order of tasting food played a greater part [23]. It gave many examples on how the order people taste food can alter how they perceive different tastes and flavors. For example, drinking orange juice in the morning after brushing teeth will make the juice taste sour and unpleasant, and that is because there is a chemical substance in the toothpaste called sodium lauryl sulphate (SLS) that blocks the sweet receptors in the tongue making any thing sweet tastes sour or bitter. The study evaluated the flavor pairing according to similarity, contrast, and synergy (food blending that brings on new flavors). It also proclaimed that the psychological aspects influence how people perceive food flavors. For instance, most people receive vanilla as something sweet due to the types of food always associated with it, not because the vanilla as a spice is sweet itself.


## 3. Methodology and System Model

Our mythology follows the same approach used in the previous studies of food pairing hypothesis investigations [4, 11, 16, 19]. However, it differs in system breakdown and modeling. We offer a clearer picture and organized explanation to the method of food pairing calculations. Our project consists of three main stages, which will be illustrated in the following subsections. The stages are data collection, data preprocessing, and the result of food pairing. The data modeling consists of calculation of real cuisine and random cuisine. We will elaborate on each stage individually to make the system model of food pairing as clear as possible. One main contribution in our project is clearly shown in the data modeling phase where we need to deal with real and random cuisines and the result of their interactions. Moreover, although data modeling is an interesting phase, it is the most challenging one. Figure 3 shows our model in the most basic level. We will dig into each stage as we explain what is being accomplished.Figure 3
System model level 1.


### 3.1. First Stage: Data Collection

The first step will be assembling recipes from old traditional Saudi cookbook such as the cooking principles of Saudi and middle eastern cuisine by Mrs. Rabha Hafiz [24]. Afterwards, for each recipe, a list of all ingredients occurring in it will be gathered. Finally, a list of flavor compounds for each ingredient will be compiled to define the flavor profile for every ingredient. The information about the flavor compounds will be gathered from “Fenaroli’s Handbook of Flavor Compounds [13].” We planned to collect ingredients’ chemical compositions manually, but the process proved to be extremely time-consuming. Fortunately, we found an available compositions dataset from the Indian food pairing studies. To recap this part, each recipe (R) is made up of a number of ingredients (i, j, …). And each ingredient is composed of many flavor compounds (F) (see Figure 4 for clearer understanding). At the end of this stage, the corpus of real cuisine will be ready for the next stage.Figure 4
Relationship between cuisine, recipes, ingredients, and flavor compounds.


### 3.2. Second Stage: Data Cleaning and Preprocessing

Once the recipes are collected and duplicates are removed, a list of ingredients occurring in all recipes will be made after unifying ingredients that have aliases. Ingredients that do not have a flavor profile will be excluded. An additional step will be translating ingredient names from Arabic to English and then highlighting the ingredients unique to Saudi cuisine. Essentially, after the data are collected, the following will be performed: (1) Discard recipes with a single ingredient. (2) Alias ingredients with different spellings and forms, for example, diced tomato and sliced tomato; both are tomatoes. And (3) Discard ingredients with unknown flavor compounds.


### 3.3. Third Stage: Data Modeling

This is the main part of our project to follow and obtain the result of our hypothesis. This stage is divided into two parts: the first part is related to the calculation of average flavor sharing of the real cuisine corpus, and the second part is related to the random cuisine generation and average flavor sharing calculation.In Table1, we will provide notations for variables and quantities to make tracing the process of our methodology easier.Table 1
Notations and their description.
NotationsDescriptionReal cuisine notationsRRepresent a recipenRThe number of ingredients in recipe RNs¯RThe average flavor sharing on recipe levelFiSet of flavor compounds found in ingredients iNs¯The average flavor sharing on cuisine levelHypothesis notationsNs¯realThe average flavor sharing of real cuisineNs¯randThe average flavor sharing of random cuisineΔNsThe difference between the flavor sharing of the real and random cuisineRandom cuisine notationsNRNumber of all recipes in the cuisineNiNumber of all ingredientsNitNumber of initial ingredients at time tNrNumber of all recipesNrtNumber of all recipes at time tfiFitness value of ingredientimNumber of ingredients to be mutated in each recipe.


#### 3.3.1. Real Cuisine Average Flavor Sharing Calculation

For better explanation of the process of flavor sharing calculation, it is advisable to do so via an example illustrated in Figure5, Let us consider the Saudi cuisine (c) that we will calculate its flavor sharing. The first step is to select a recipe (R) called green beans salad from Saudi’s recipes. Suppose our recipe has the following ingredients: almonds, green beans, coconut, and anchovies. For every ingredient, we get the list of flavor compounds present in that ingredient. Secondly, for each pair of ingredients such as green beans (i) and coconut (j), we calculate the number of shared compounds (Fi) of green beans and (Fj) for coconut according to the following equation:(4)NsR=Fi∩Fj.Figure 5
Tiny example of real cuisine average flavor sharing calculation.The intersection between the set of flavor compounds of green beans and the set of flavor compounds of coconut will be the common flavor shared between the two ingredients. This step will loop for each unique pair of ingredients inR as illustrated in Figure 6. Consequently, the average number of shared flavor compounds in recipe R with the four different ingredients in our example (almonds, green beans, coconut, and anchovies) is calculated by the following equation:(5)Ns¯R=2nRnR−1∑i.jϵR.i≠jFi∩Fj.Figure 6
Co-occurring ingredients using.The resulting numberNs¯R is the average flavor sharing on recipe level. We need to calculate it for the whole cuisine; therefore, the process will loop for every single recipe in the Saudi cuisine to get the average flavor sharing result on a cuisine level.The average of flavor sharing of the whole cuisine denoted byNs¯ is calculated with the following equation:(6)Ns¯=∑RNsRNc3.Next,Ns¯ needs to be compared to a null hypothesis to validate whether Ns¯ is indicative of whether similar flavors taste good together. Thus, Ns¯ will be compared to a randomly generated cuisine:(7)ΔNs=Ns¯real−Ns¯rand.The difference between the average of flavor sharing of the real and random cuisines will answer the hypothesis, which is Stage 4 in our system model as shown in Figure3. The generation of the random cuisine is accomplished in part 2 in the next section. Figure 7 summarizes the flavor sharing calculation.Figure 7
Flavor sharing calculation of real cuisine.


#### 3.3.2. Random Cuisine Corpus Generation and Average Flavor Sharing Calculation

Building the random cuisine is an integral part of the equation that will solve the food pairing hypothesis for Saudi cuisine.The genetic algorithm copy-mutate model used in [21] will facilitate this process. Generating the random cuisine needs to be broken down into achievable steps based on previous studies, which is shown in the following Algorithm 2.Algorithm 2: GA food pairing.
(1)
Initial pool containingN number of ingredients.(2)
GenerateK number of recipes containing S ingredients randomly constructed from the initial pool of ingredients.(3)
From the pool ofK recipes select one recipe randomly.(4)
Copy the recipe.(5)
Mutate the copied recipeM times.(6)
Randomly select an ingredient from the copied recipe.(7)
Randomly select an ingredient from ingredients pool.(8)
Compare fitness value of the two ingredients.(9)
Replace the ingredient in the recipe with the ingredient having the higher fitness value.(10)
Add the mutated recipe to the pool of recipes.(11)
Introduce a new ingredient to the pool of ingredients.(12)
Repeat steps 3 to 7 until the corpus of random recipes match the number of recipes in the real cuisine.Figures8–10 show that the random cuisine generation is demonstrated with a tiny example.Figure 8
Tiny example of random recipe generation (step1).Figure 9
Recipe interaction/mutation process iteration 1.Figure 10
Recipe interaction/mutation process iteration 2.Once the first collection of random recipes is generated, the following steps are ready to be performed. Figures9 and 10 clarify the next step of random cuisine generation using the same example used in Figure 9, which shows the first iteration of the interaction process. It represents a simulation process. The details are written in the upper left corner box. Figure 10 picks up where the previous process stopped. Tracing the steps of the interaction can also be performed by following the numbered steps. Figure 11 shows how cuisine corpus can be randomly created. Figure 12 shows the random cuisine corpus generation and average flavor calculation.Figure 11
Random cuisine corpus generation process step 1.Figure 12
Random cuisine corpus.


## 3.1. First Stage: Data Collection

The first step will be assembling recipes from old traditional Saudi cookbook such as the cooking principles of Saudi and middle eastern cuisine by Mrs. Rabha Hafiz [24]. Afterwards, for each recipe, a list of all ingredients occurring in it will be gathered. Finally, a list of flavor compounds for each ingredient will be compiled to define the flavor profile for every ingredient. The information about the flavor compounds will be gathered from “Fenaroli’s Handbook of Flavor Compounds [13].” We planned to collect ingredients’ chemical compositions manually, but the process proved to be extremely time-consuming. Fortunately, we found an available compositions dataset from the Indian food pairing studies. To recap this part, each recipe (R) is made up of a number of ingredients (i, j, …). And each ingredient is composed of many flavor compounds (F) (see Figure 4 for clearer understanding). At the end of this stage, the corpus of real cuisine will be ready for the next stage.Figure 4
Relationship between cuisine, recipes, ingredients, and flavor compounds.


## 3.2. Second Stage: Data Cleaning and Preprocessing

Once the recipes are collected and duplicates are removed, a list of ingredients occurring in all recipes will be made after unifying ingredients that have aliases. Ingredients that do not have a flavor profile will be excluded. An additional step will be translating ingredient names from Arabic to English and then highlighting the ingredients unique to Saudi cuisine. Essentially, after the data are collected, the following will be performed: (1) Discard recipes with a single ingredient. (2) Alias ingredients with different spellings and forms, for example, diced tomato and sliced tomato; both are tomatoes. And (3) Discard ingredients with unknown flavor compounds.


## 3.3. Third Stage: Data Modeling

This is the main part of our project to follow and obtain the result of our hypothesis. This stage is divided into two parts: the first part is related to the calculation of average flavor sharing of the real cuisine corpus, and the second part is related to the random cuisine generation and average flavor sharing calculation.In Table1, we will provide notations for variables and quantities to make tracing the process of our methodology easier.Table 1
Notations and their description.
NotationsDescriptionReal cuisine notationsRRepresent a recipenRThe number of ingredients in recipe RNs¯RThe average flavor sharing on recipe levelFiSet of flavor compounds found in ingredients iNs¯The average flavor sharing on cuisine levelHypothesis notationsNs¯realThe average flavor sharing of real cuisineNs¯randThe average flavor sharing of random cuisineΔNsThe difference between the flavor sharing of the real and random cuisineRandom cuisine notationsNRNumber of all recipes in the cuisineNiNumber of all ingredientsNitNumber of initial ingredients at time tNrNumber of all recipesNrtNumber of all recipes at time tfiFitness value of ingredientimNumber of ingredients to be mutated in each recipe.


### 3.3.1. Real Cuisine Average Flavor Sharing Calculation

For better explanation of the process of flavor sharing calculation, it is advisable to do so via an example illustrated in Figure5, Let us consider the Saudi cuisine (c) that we will calculate its flavor sharing. The first step is to select a recipe (R) called green beans salad from Saudi’s recipes. Suppose our recipe has the following ingredients: almonds, green beans, coconut, and anchovies. For every ingredient, we get the list of flavor compounds present in that ingredient. Secondly, for each pair of ingredients such as green beans (i) and coconut (j), we calculate the number of shared compounds (Fi) of green beans and (Fj) for coconut according to the following equation:(4)NsR=Fi∩Fj.Figure 5
Tiny example of real cuisine average flavor sharing calculation.The intersection between the set of flavor compounds of green beans and the set of flavor compounds of coconut will be the common flavor shared between the two ingredients. This step will loop for each unique pair of ingredients inR as illustrated in Figure 6. Consequently, the average number of shared flavor compounds in recipe R with the four different ingredients in our example (almonds, green beans, coconut, and anchovies) is calculated by the following equation:(5)Ns¯R=2nRnR−1∑i.jϵR.i≠jFi∩Fj.Figure 6
Co-occurring ingredients using.The resulting numberNs¯R is the average flavor sharing on recipe level. We need to calculate it for the whole cuisine; therefore, the process will loop for every single recipe in the Saudi cuisine to get the average flavor sharing result on a cuisine level.The average of flavor sharing of the whole cuisine denoted byNs¯ is calculated with the following equation:(6)Ns¯=∑RNsRNc3.Next,Ns¯ needs to be compared to a null hypothesis to validate whether Ns¯ is indicative of whether similar flavors taste good together. Thus, Ns¯ will be compared to a randomly generated cuisine:(7)ΔNs=Ns¯real−Ns¯rand.The difference between the average of flavor sharing of the real and random cuisines will answer the hypothesis, which is Stage 4 in our system model as shown in Figure3. The generation of the random cuisine is accomplished in part 2 in the next section. Figure 7 summarizes the flavor sharing calculation.Figure 7
Flavor sharing calculation of real cuisine.


### 3.3.2. Random Cuisine Corpus Generation and Average Flavor Sharing Calculation

Building the random cuisine is an integral part of the equation that will solve the food pairing hypothesis for Saudi cuisine.The genetic algorithm copy-mutate model used in [21] will facilitate this process. Generating the random cuisine needs to be broken down into achievable steps based on previous studies, which is shown in the following Algorithm 2.Algorithm 2: GA food pairing.
(1)
Initial pool containingN number of ingredients.(2)
GenerateK number of recipes containing S ingredients randomly constructed from the initial pool of ingredients.(3)
From the pool ofK recipes select one recipe randomly.(4)
Copy the recipe.(5)
Mutate the copied recipeM times.(6)
Randomly select an ingredient from the copied recipe.(7)
Randomly select an ingredient from ingredients pool.(8)
Compare fitness value of the two ingredients.(9)
Replace the ingredient in the recipe with the ingredient having the higher fitness value.(10)
Add the mutated recipe to the pool of recipes.(11)
Introduce a new ingredient to the pool of ingredients.(12)
Repeat steps 3 to 7 until the corpus of random recipes match the number of recipes in the real cuisine.Figures8–10 show that the random cuisine generation is demonstrated with a tiny example.Figure 8
Tiny example of random recipe generation (step1).Figure 9
Recipe interaction/mutation process iteration 1.Figure 10
Recipe interaction/mutation process iteration 2.Once the first collection of random recipes is generated, the following steps are ready to be performed. Figures9 and 10 clarify the next step of random cuisine generation using the same example used in Figure 9, which shows the first iteration of the interaction process. It represents a simulation process. The details are written in the upper left corner box. Figure 10 picks up where the previous process stopped. Tracing the steps of the interaction can also be performed by following the numbered steps. Figure 11 shows how cuisine corpus can be randomly created. Figure 12 shows the random cuisine corpus generation and average flavor calculation.Figure 11
Random cuisine corpus generation process step 1.Figure 12
Random cuisine corpus.


## 3.3.1. Real Cuisine Average Flavor Sharing Calculation

For better explanation of the process of flavor sharing calculation, it is advisable to do so via an example illustrated in Figure5, Let us consider the Saudi cuisine (c) that we will calculate its flavor sharing. The first step is to select a recipe (R) called green beans salad from Saudi’s recipes. Suppose our recipe has the following ingredients: almonds, green beans, coconut, and anchovies. For every ingredient, we get the list of flavor compounds present in that ingredient. Secondly, for each pair of ingredients such as green beans (i) and coconut (j), we calculate the number of shared compounds (Fi) of green beans and (Fj) for coconut according to the following equation:(4)NsR=Fi∩Fj.Figure 5
Tiny example of real cuisine average flavor sharing calculation.The intersection between the set of flavor compounds of green beans and the set of flavor compounds of coconut will be the common flavor shared between the two ingredients. This step will loop for each unique pair of ingredients inR as illustrated in Figure 6. Consequently, the average number of shared flavor compounds in recipe R with the four different ingredients in our example (almonds, green beans, coconut, and anchovies) is calculated by the following equation:(5)Ns¯R=2nRnR−1∑i.jϵR.i≠jFi∩Fj.Figure 6
Co-occurring ingredients using.The resulting numberNs¯R is the average flavor sharing on recipe level. We need to calculate it for the whole cuisine; therefore, the process will loop for every single recipe in the Saudi cuisine to get the average flavor sharing result on a cuisine level.The average of flavor sharing of the whole cuisine denoted byNs¯ is calculated with the following equation:(6)Ns¯=∑RNsRNc3.Next,Ns¯ needs to be compared to a null hypothesis to validate whether Ns¯ is indicative of whether similar flavors taste good together. Thus, Ns¯ will be compared to a randomly generated cuisine:(7)ΔNs=Ns¯real−Ns¯rand.The difference between the average of flavor sharing of the real and random cuisines will answer the hypothesis, which is Stage 4 in our system model as shown in Figure3. The generation of the random cuisine is accomplished in part 2 in the next section. Figure 7 summarizes the flavor sharing calculation.Figure 7
Flavor sharing calculation of real cuisine.


## 3.3.2. Random Cuisine Corpus Generation and Average Flavor Sharing Calculation

Building the random cuisine is an integral part of the equation that will solve the food pairing hypothesis for Saudi cuisine.The genetic algorithm copy-mutate model used in [21] will facilitate this process. Generating the random cuisine needs to be broken down into achievable steps based on previous studies, which is shown in the following Algorithm 2.Algorithm 2: GA food pairing.
(1)
Initial pool containingN number of ingredients.(2)
GenerateK number of recipes containing S ingredients randomly constructed from the initial pool of ingredients.(3)
From the pool ofK recipes select one recipe randomly.(4)
Copy the recipe.(5)
Mutate the copied recipeM times.(6)
Randomly select an ingredient from the copied recipe.(7)
Randomly select an ingredient from ingredients pool.(8)
Compare fitness value of the two ingredients.(9)
Replace the ingredient in the recipe with the ingredient having the higher fitness value.(10)
Add the mutated recipe to the pool of recipes.(11)
Introduce a new ingredient to the pool of ingredients.(12)
Repeat steps 3 to 7 until the corpus of random recipes match the number of recipes in the real cuisine.Figures8–10 show that the random cuisine generation is demonstrated with a tiny example.Figure 8
Tiny example of random recipe generation (step1).Figure 9
Recipe interaction/mutation process iteration 1.Figure 10
Recipe interaction/mutation process iteration 2.Once the first collection of random recipes is generated, the following steps are ready to be performed. Figures9 and 10 clarify the next step of random cuisine generation using the same example used in Figure 9, which shows the first iteration of the interaction process. It represents a simulation process. The details are written in the upper left corner box. Figure 10 picks up where the previous process stopped. Tracing the steps of the interaction can also be performed by following the numbered steps. Figure 11 shows how cuisine corpus can be randomly created. Figure 12 shows the random cuisine corpus generation and average flavor calculation.Figure 11
Random cuisine corpus generation process step 1.Figure 12
Random cuisine corpus.


## 4. Food Pairing Result Analysis

After running the functions on our dataset, beginning from pairs of ingredients, the average flavor sharing of recipes and that of the Saudi cuisineNs¯real are calculated. Our analysis showed that the flavor sharing value observed for our cuisine was found to be Ns¯real=27.936 ranging between 83.1429 and 1.000. We also calculated the Ns¯rand using the only ingredients found solely in Saudi cuisine. However, because of the unpredictability of copy-mutate random function, we needed to neutralize that effect. Therefore, we generated forty sets of 100 random copy-mutate recipes and then studied the average of all sets. We found that the average flavor sharing of random cuisine ranges between 35.8433 and 12.8111, and the average results of Ns¯rand=23.596. According to these results, we applied the values to the equation that will answer our question: is the food pairing hypothesis of Saudi cuisine going to be positive or negative?(8)ΔNs=27.936−23.596=4.340.Apparently, the positive results mean that ingredients that share many flavor compounds are more likely to be used together in our cuisine. Table2 shows the values of flavor sharing of both random and real cuisines and the difference between them.Table 2
Values of flavor sharing of both random and real cuisines and the difference between them.
NotationsValueDescriptionHypothesis notationsNs¯real27.9365The average flavor sharing of real cuisineNs¯rand23.596The average flavor sharing of random cuisineΔNs4.340The difference between the flavor sharing of the real and random cuisinesInitially, we thought that our cuisine might render negative results like the Indian cuisine since both cuisines share similarities of using spices. In Indian cuisine, spice was proved to be the critical ingredient that tipped the scale of Indian cuisine toward the negative side. However, the evidence showed that even though Saudi cuisine uses spice, the usage is limited to a handful of spices. These are consisting of: black pepper, cumin, cardamom, and coriander. This list of spice is incomparable to the extensive and versatile list of spices the Indian cuisine uses, which in turn made the Indian cuisine show negative food pairing results.During our project, we observed that there are many cookbooks that offer authentic Saudi recipes, and other recipes from Arabic or Western cuisine with some modifications that gave the modified dishes the distinct flavor of our cuisine. Nevertheless, the numbers of truly authentic Saudi recipes found in those books were relatively small and invariant. As a result, none of the cookbooks we browsed offered 100% truly authentic Saudi recipes. It could be because Saudi recipes are influenced by people coming to Haj each year. Moreover, some Saudi recipes are handed down from generation to generation by word of the mouth, and we could not find these recipes in any cookbook. Nonetheless, thanks to nowadays-rapid spread of social media channels, which made these recipes begin to emerge and spread on Instagram, Snapchat, and cooking blogs and forums. Due to the time constraints during the development of our project, we were unable to collect those recipes due to the unstructured layout of media websites and the enormous number of preparation way that makes it difficult to choose one recipe.Therefore, we adopted an authentic Saudi cookbook to collect our recipes for our project. As stated before, we have collected approximately 100 dishes to build our real cuisine. In order to achieve progress in our project, we calculated the fitness value for each ingredient. Our aim was to scale the frequency of ingredients to be a value between 0 and 1.There are many aspects that determine the fitness value for the ingredients such as the availability, the nutritional value, the cost, and the texture of the ingredients. Unfortunately, these aspects are not easy to evaluate. Previous studies made their calculation of fitness value either randomly or according to the frequency of ingredients [25]. In our study, we determined the fitness value of the ingredients based on their chemical composition and their frequency [21].The conclusion of our findings may be affected by the available dataset on chemical compositions of ingredients. Fenaroli’s and VCF’s datasets on chemical composition are the reference datasets for researchers in food science. It has been found that Fenaroli’s dataset has a vast collection of ingredients, but it is lacking in the number of compositions documented in each one. On the other hand, VCF has a smaller collection of ingredients, but the information in chemical compositions in each ingredient is richer and more comprehensive. However, we were unable to obtain access to VCF dataset due to access restrictions; thus, we used Fenaroli’s dataset in our study.


### 4.1. Most Frequent Ingredients in Saudi Cuisine

From our dataset collections, Table3 shows extract the most used ingredients in Saudi cuisine. Interestingly, black pepper, onion, tomato, garlic, sunflower oil, and cumin are the most used ingredients in our cooking. Mainly, these species are the fundamental ingredients, which make up most of our dishes from stews to soups and rice.Table 3
Topmost frequent ingredients of Saudi.
IngredientsFrequency of ingredientFitness value [0, 1]Black pepper780.987341772Onion680.860759494Tomato530.670886076Garlic490.620253165Sunflower oil440.556962025Cumin430.544303797Mutton270.341772152Cardamom260.329113924Chicken260.329113924Egg250.316455696Ghee230.291139241Cayenne210.265822785Cinnamon210.265822785Wheat200.253164557Beef200.253164557Rice190.240506329Lemon180.227848101Coriander_cumin_seeds_powder170.215189873Coriander150.189873418


### 4.2. Ingredients’ Visualization

To make our findings more appearing, Figure6 displays the most co-occurring ingredients in Saudi cuisine using a Voyant online visualization tool [26]. Furthermore, Figure 13 shows the most important ingredients in Saudi cuisine, where the size of the bubble indicates the frequency; the larger the bubble, the higher value of the ingredient frequency using Tableau application [25]. Figure 14 shows the important multi-ingredients co-occurrence as a heat map figure using VOSviewer application. VOSvewier is a tool that visualize co-occurrence networks of important terms [27]. Both figures present the ingredients that make our cuisine unique among other cuisines.Figure 13
The frequency of ingredients.Figure 14
Multi-ingredients co-occurrence using VOSviewer application.


## 4.1. Most Frequent Ingredients in Saudi Cuisine

From our dataset collections, Table3 shows extract the most used ingredients in Saudi cuisine. Interestingly, black pepper, onion, tomato, garlic, sunflower oil, and cumin are the most used ingredients in our cooking. Mainly, these species are the fundamental ingredients, which make up most of our dishes from stews to soups and rice.Table 3
Topmost frequent ingredients of Saudi.
IngredientsFrequency of ingredientFitness value [0, 1]Black pepper780.987341772Onion680.860759494Tomato530.670886076Garlic490.620253165Sunflower oil440.556962025Cumin430.544303797Mutton270.341772152Cardamom260.329113924Chicken260.329113924Egg250.316455696Ghee230.291139241Cayenne210.265822785Cinnamon210.265822785Wheat200.253164557Beef200.253164557Rice190.240506329Lemon180.227848101Coriander_cumin_seeds_powder170.215189873Coriander150.189873418


## 4.2. Ingredients’ Visualization

To make our findings more appearing, Figure6 displays the most co-occurring ingredients in Saudi cuisine using a Voyant online visualization tool [26]. Furthermore, Figure 13 shows the most important ingredients in Saudi cuisine, where the size of the bubble indicates the frequency; the larger the bubble, the higher value of the ingredient frequency using Tableau application [25]. Figure 14 shows the important multi-ingredients co-occurrence as a heat map figure using VOSviewer application. VOSvewier is a tool that visualize co-occurrence networks of important terms [27]. Both figures present the ingredients that make our cuisine unique among other cuisines.Figure 13
The frequency of ingredients.Figure 14
Multi-ingredients co-occurrence using VOSviewer application.


## 5. Conclusions

Over the last years, food science gained a lot of attention in the Western and European countries, especially about the new field of computational gastronomy. Moreover, the application of knowledge extraction in food science has been opened up new and unexplored directions for the food business. The food pairing hypothesis was all the rage during the 1990s. Not only chefs got interested in this hypothesis, but also scientists from various disciplines started to explore it in relation to different national cultures and cuisines. Fortunately, once this new field is recognized in countries of the Arab world, it will open doors for future opportunities to restaurants and home cooking businesses to become confidently innovative. Suffice to say that a project like this will scratch the surface to what lay beneath computational gastronomy. In this project, we have studied the food pairing hypothesis in Saudi cuisine. We have collected our recipes for an authentic old Saudi cookbook and used available dataset for compounds found in our ingredients. Then, we programmed the mathematical models to obtain the results. From our investigation, we found that Saudi cuisine tends to contain ingredients that share similar flavor compounds. This means that the food pairing hypothesis for our cuisine was found to be positive.



---

*Source: 3627715-2021-12-14.xml*