Flavor Network

Source Notebook

The flavor network represents food ingredients as vertices, with edges connecting ingredients that share flavor compounds

Details

The vertices in ResourceData["Flavor Network", "FlavorNetwork"] represent food ingredients, while edges connect ingredients that share flavor compounds.
ResourceData["Flavor Network", "FlavorNetworkWeights"] provides the edge weights, defined as the number of flavor compounds shared between each pair of ingredients.
ResourceData["Flavor Network", "FlavorNetwork"] is derived from the flavor profile graph developed by Yong-Yeol Ahn et al.[1]. The original Yong-Yeol Ahn et. al. bipartite graph can be retrieved using ResourceData["Flavor Network", "FlavorProfile"] and contains 1,530 food ingredients, their associated flavor compounds, and 36,781 the ingredient–compound relationships.
Each ingredient can be classified into a food category using ResourceData["Flavor Network","IngredientsCategory"], which includes: {"flower", "plant", "plant derivative", "fish/seafood", "herb", "spice", "vegetable", "nut/seed/pulse", "meat", "fruit", "animal product", "cereal/crop", "dairy", "alcoholic beverage"}.
Flavor compounds can be identified using CAS numbers available in ResourceData["Flavor Network","CAS number"].
The network is highly dense and difficult to visualize directly. To address this, backbone extraction can be applied to retain only statistically significant connections, producing a sparser graph such as ResourceData["Flavor Network","Backbone"]. This backbone, originally extracted by Ling Cheng[2], using data from yummlyrecipes.com, yields a clearer and more interpretable structure while preserving the most relevant flavor relationships.
The flavor network is commonly used to project recipes from ingredient space into flavor space. Applications include building dish recommendation systems based on flavor similarity and identifying dishes with comparable flavor profiles across cuisines.

(221777 elements)

Examples

Basic Examples (3) 

Retrieve the flavor network:

In[1]:=
GraphPlot[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"], GraphLayout -> "GravityEmbedding"]
Out[1]=

Retrieve the bipartite flavor profile network:

In[2]:=
GraphPlot[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorProfile"], Sequence[
 GraphLayout -> "BipartiteEmbedding", EdgeStyle -> Directive[Thin, 
Opacity[0.04]]]]
Out[2]=

Retrieve the backbone network:

In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]
Out[3]=

Scope & Additional Elements (4) 

Extract the vertex list of the backbone network:

In[4]:=
VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]]
Out[4]=

Generate a word cloud of the flavor network:

In[5]:=
WordCloud[Flatten[StringSplit[VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]], "_"], 1]]
Out[5]=

Generate a histogram of the network edge weights:

In[6]:=
Histogram[Values[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetworkWeights"]], Sequence[
 500, FrameLabel -> {"Edge Weight"}, PlotTheme -> "Detailed"]]
Out[6]=

Count the number of ingredients in each ingredient category:

In[7]:=
Counts[Values[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "IngredientCategory"]]]
Out[7]=

Visualizations (4) 

Plot the flavor network with vertex colors indicating ingredient categories:

In[8]:=
color = ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "IngredientCategory"] /. Thread[{"plant", "fruit", "spice", "herb", "meat", "alcoholic beverage", "cereal/crop", "plant derivative", "dairy",
       "vegetable", "fish/seafood", "nut/seed/pulse", "flower", "animal product"} -> {RGBColor[1, 0.525, 0.329], RGBColor[
      1, 0.996, 0.399], RGBColor[1, 0.786, 0.317], RGBColor[
      0.711, 1, 0.586], RGBColor[0.787, 0.29, 0.34500000000000003`], RGBColor[0.495, 0.21, 0.21], RGBColor[
      1, 0.876, 0.9420000000000001], RGBColor[0.425, 0.585, 0.483], GrayLevel[1], RGBColor[0.312, 0.749, 0.47900000000000004`], RGBColor[0.526, 0.68, 1], RGBColor[0.71, 0.622, 0.669], RGBColor[1, 0.5660000000000001, 0.683], RGBColor[
      0.6, 0.4, 0.178]}];
In[9]:=
GraphPlot[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"], VertexStyle -> Thread[VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]] -> (VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]] /. color)]]
Out[9]=

Plot the backbone with vertex sizes proportional to vertex weights:

In[10]:=
color = ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "IngredientCategory"] /. Thread[{"plant", "fruit", "spice", "herb", "meat", "alcoholic beverage", "cereal/crop", "plant derivative", "dairy",
       "vegetable", "fish/seafood", "nut/seed/pulse", "flower", "animal product"} -> {RGBColor[1, 0.525, 0.329], RGBColor[
      1, 0.996, 0.399], RGBColor[1, 0.786, 0.317], RGBColor[
      0.711, 1, 0.586], RGBColor[0.787, 0.29, 0.34500000000000003`], RGBColor[0.495, 0.21, 0.21], RGBColor[
      1, 0.876, 0.9420000000000001], RGBColor[0.425, 0.585, 0.483], GrayLevel[1], RGBColor[0.312, 0.749, 0.47900000000000004`], RGBColor[0.526, 0.68, 1], RGBColor[0.71, 0.622, 0.669], RGBColor[1, 0.5660000000000001, 0.683], RGBColor[
      0.6, 0.4, 0.178]}];
In[11]:=
vertexSize = ((Rescale[#, {-.5, .1}]) & /@ AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], VertexWeight]);
In[12]:=
Graph[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], GraphLayout -> "GravityEmbedding", VertexStyle -> color, VertexSize -> Thread[VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]] -> vertexSize]]
Out[12]=

Plot the backbone with edge sizes proportional to edge weights:

In[13]:=
color = ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "IngredientCategory"] /. Thread[{"plant", "fruit", "spice", "herb", "meat", "alcoholic beverage", "cereal/crop", "plant derivative", "dairy",
       "vegetable", "fish/seafood", "nut/seed/pulse", "flower", "animal product"} -> {RGBColor[1, 0.525, 0.329], RGBColor[
      1, 0.996, 0.399], RGBColor[1, 0.786, 0.317], RGBColor[
      0.711, 1, 0.586], RGBColor[0.787, 0.29, 0.34500000000000003`], RGBColor[0.495, 0.21, 0.21], RGBColor[
      1, 0.876, 0.9420000000000001], RGBColor[0.425, 0.585, 0.483], GrayLevel[1], RGBColor[0.312, 0.749, 0.47900000000000004`], RGBColor[0.526, 0.68, 1], RGBColor[0.71, 0.622, 0.669], RGBColor[1, 0.5660000000000001, 0.683], RGBColor[
      0.6, 0.4, 0.178]}];
In[14]:=
vertexSize = ((Rescale[#, {-.5, .1}]) & /@ AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], VertexWeight]);
In[15]:=
edgeStye = Thread[{(Thickness[#] & /@ (AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], EdgeWeight]/19000.))}];
In[16]:=
Graph[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], GraphLayout -> "GravityEmbedding", VertexStyle -> color, VertexSize -> Thread[VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]] -> vertexSize], EdgeStyle -> Thread[EdgeList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]] -> edgeStye]]
Out[16]=

Plot the backbone with displayed vertex labels:

In[17]:=
color = ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "IngredientCategory"] /. Thread[{"plant", "fruit", "spice", "herb", "meat", "alcoholic beverage", "cereal/crop", "plant derivative", "dairy",
       "vegetable", "fish/seafood", "nut/seed/pulse", "flower", "animal product"} -> {RGBColor[1, 0.525, 0.329], RGBColor[
      1, 0.996, 0.399], RGBColor[1, 0.786, 0.317], RGBColor[
      0.711, 1, 0.586], RGBColor[0.787, 0.29, 0.34500000000000003`], RGBColor[0.495, 0.21, 0.21], RGBColor[
      1, 0.876, 0.9420000000000001], RGBColor[0.425, 0.585, 0.483], GrayLevel[1], RGBColor[0.312, 0.749, 0.47900000000000004`], RGBColor[0.526, 0.68, 1], RGBColor[0.71, 0.622, 0.669], RGBColor[1, 0.5660000000000001, 0.683], RGBColor[
      0.6, 0.4, 0.178]}];
In[18]:=
vertexSize = ((Rescale[#, {-.5, .1}]) & /@ AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], VertexWeight]);
In[19]:=
edgeStye = Thread[{(Thickness[#] & /@ (AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], EdgeWeight]/19000.))}];
In[20]:=
Graph[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], GraphLayout -> "GravityEmbedding", VertexStyle -> color, VertexSize -> Thread[VertexList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]] -> vertexSize], EdgeStyle -> Thread[EdgeList[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]] -> edgeStye],
 VertexLabels -> Placed[Automatic, Center]]
Out[20]=

Analysis (10) 

Compute the vertex count of the flavor network:

In[21]:=
VertexCount[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]]
Out[21]=

Compute the edge count of the flavor network:

In[22]:=
EdgeCount[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]]
Out[22]=

Compute the graph diameter of the flavor network:

In[23]:=
GraphDiameter[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]]
Out[23]=

Compute the graph radius of the flavor network:

In[24]:=
GraphRadius[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]]
Out[24]=

Check whether the backbone network is a weighted graph:

In[25]:=
WeightedGraphQ[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]]
Out[25]=

Generate a histogram of backbone vertex weights:

In[26]:=
Histogram[AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], VertexWeight], 500, FrameLabel -> {"VertexWeight"}, PlotTheme -> "Detailed"]
Out[26]=

Generate a histogram of backbone edge weights:

In[27]:=
Histogram[AnnotationValue[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"], EdgeWeight], Sequence[
 500, FrameLabel -> {"EdgeWeight"}, PlotTheme -> "Detailed"]]
Out[27]=

Plot the vertex degree distribution of the flavor network:

In[28]:=
Histogram[VertexDegree[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "FlavorNetwork"]], Sequence[
 200, FrameLabel -> {"VertexDegree"}, PlotTheme -> "Detailed"]]
Out[28]=

Detect communities in the backbone network:

In[29]:=
FindGraphCommunities[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]]
Out[29]=

Plot the detected communities of the backbone network:

In[30]:=
CommunityGraphPlot[ResourceData[\!\(\*
TagBox["\"\<Flavor Network\>\"",
#& ,
BoxID -> "ResourceTag-Flavor Network-Input",
AutoDelete->True]\), "Backbone"]]
Out[30]=

Wolfram Discrete Computation, "Flavor Network" from the Wolfram Data Repository (2026)  

Data Resource History

Source Metadata

Data Downloads

Publisher Information