# Probing the hot circumgalactic medium of external galaxies in X-ray
absorption II: a luminous spiral galaxy at $z\approx 0.225$

Smita Mathur,1,2 Sanskriti Das,3 Anjali Gupta4 and Yair Krongold5
1Astronomy Department, The Ohio State University, Columbus, OH 43210, USA
2Center for Cosmology and Astro-Particle Physics, The Ohio State University,
Columbus, OH 43210
3 Kavli Institute for Particle Astrophysics and Cosmology, Stanford
University, 452 Lomita Mall, Stanford, CA 94305, USA
4Columbus State Community College, Columbus, OH, USA
5 Instituto de Astronomia, Universidad Nacional Autonoma de Mexico, 04510
Mexico City, Mexico
E-mail<EMAIL_ADDRESS>
(Accepted XXX. Received YYY; in original form ZZZ)

###### Abstract

The circumgalactic medium (CGM) is the most massive baryonic component of a
spiral galaxy, shock heated to about $10^{6}$K for an $\rm L^{\star}$ galaxy.
The CGM of the Milky Way has been well-characterized through X-ray absorption
line spectroscopy. However, the paucity of bright background sources makes it
challenging to probe the CGM of external galaxies. Previously, using broad O
vi absorption as a signpost, we successfully detected the CGM of one galaxy in
X-rays. Here we report on the detection of the O vii $K\alpha$ absorption line
at the redshift of a spiral galaxy at $z\approx 0.225$ using 1.2 Ms of Chandra
observations. This is a robust detection, clearly showing the presence of the
hot gas. The mass in the hot phase is at least an order of magnitude larger
than that in the cooler phases detected in the UV. The presence of hot gas
$116h^{-1}$kpc from the center of this galaxy provides credence to the
existence of the extended CGM of the Milky Way. There has been a report of the
detection of O vii absorption from the warm-hot intergalactic medium in this
sightline using stacking analysis on older dataset. We argue that the
absorption line is from the CGM of the $z\approx 0.225$ galaxy instead.

###### keywords:

galaxies: halos—galaxies: formation—galaxies: evolution—quasars: absorption
lines—X-rays: galaxies

††pubyear: 2023††pagerange: Probing the hot circumgalactic medium of external
galaxies in X-ray absorption II: a luminous spiral galaxy at $z\approx
0.225$–Probing the hot circumgalactic medium of external galaxies in X-ray
absorption II: a luminous spiral galaxy at $z\approx 0.225$

##  1 Introduction

The circumgalactic medium (CGM) is the gaseous medium filling the halo of a
spiral galaxy. It is the most volume filling and the most massive baryonic
component of a galaxy, shock heated to about $10^{6}$K for an $\rm L^{\star}$
galaxy, in the process of galaxy formation. Therefore, it is critical to
understand the CGM to understand galaxy formation and evolution (see the
review by Tumlinson et al. (2017); Faucher-Giguere & Oh (2023)). Given the
high temperature, the CGM can be observed effectively in X-rays (see the
review by Mathur (2022)).

At high temperatures ($\approx 10^{6}$–$10^{7}$K) metals become highly
ionized, dominated by He-like and H-like charge states, observable only
through X-ray absorption and emission lines; we will refer to this temperature
range as “warm-hot” or “hot" in this paper. The Milky Way CGM has been studied
in both X-ray emission and absorption, providing complementary information.
The emission observations (Snowden et al., 2000; Smith et al., 2007; Galeazzi
et al., 2007; Henley et al., 2007; Henley & Shelton, 2008; Gupta et al., 2009;
Das et al., 2019c; Gupta et al., 2023; Bhattacharyya et al., 2023) are biased
to detecting denser gas at a narrow temperature range where the emissivity of
the ion (say, O vii) peaks. Absorption studies, on the other hand, are
necessary to detect low-density diffuse gas permeating the halo, over the
entire temperature range over which the ionization fraction of an ion (say, O
vii) is high. Absorption line spectroscopy has been used effectively to
characterize the Milky Way CGM (Nicastro et al., 2002; Williams et al., 2005;
Fang et al., 2006; Gupta et al., 2012, 2014; Miller & Bregman, 2015; Das et
al., 2019a; Das et al., 2021; Lara-DI et al., 2023).

Detecting the hot CGM of individual external galaxies, however, is difficult.
For emission studies, the CGM flux drops with distance from us, making it hard
to isolate the CGM signal from the background. It is no surprise, therefore,
that the CGM of a few ($\sim 8$) super-$L^{\star}$ galaxies and only one
$\approx\rm L^{\star}$ galaxy, NGC 3221, have been detected in emission (Das
et al., 2019b; Das et al., 2020, and references therein). Absorption line
spectroscopy poses different challenges. Given the limitations of current
technology, the background sources need to be very bright to obtain a good
enough spectrum for detecting weak intervening absorption lines. Such X-ray
bright quasars are few, and not necessarily well-aligned with foreground
galaxies, making blind searches of intervening absorbers unfeasible.

In order to successfully detect $z>0$ X-ray absorption lines, we can use
"signposts" of absorption systems at other wavelengths. Typically, O vi
absorption lines are produced in gas at $T\approx 10^{5.5}$K. However, if they
are produced in the hot gas, the line would be thermally broadened. This makes
broad O vi absorption lines a good proxy for the hot gas. Mathur et al. (2021)
observed the sightline to PKS$0405-123$ passing through the CGM of a galaxy at
$z\approx 0.167$, with known broad O vi absorption. They detected the O vii
$K\alpha$ absorption line at the galaxy redshift and their hot phase model was
consistent with that predicted from UV data by Savage et al. (2010).
Alternatively, one can use Lyman limit systems (LLSs) as signposts of
intervening galaxies. Nicastro et al. (2023) stacked X-ray spectra of three
background quasars with known LLSs and successfully detected O vii absorption
associated with the CGM of the galaxies. Here we report on the detection of
the O vii absorption line at the redshift of an intervening O vi absorption
system in the sightline to an X-ray bright blazar.

###  1.1 Sightline to H1821+643

The sightline to the UV- and X-ray-bright blazar H1821+643 has been studied
extensively. There are six intervening O vi absorption systems in this
sightline, observed with the Hubble Space Telescope (HST; Tripp et al. (2000))
and the Far Ultraviolet Space Explorer (FUSE; Oegerle et al. (2000)). We
observed H1821+643 with Chandra Low Energy Transmission Grating (LETG) and
Advanced CCD Imaging Spectrometer (ACIS) for 500ks to search for the elusive
warm-hot intergalactic medium (Mathur et al. (2003) at the redshifts of the O
vi systems
($z1=0.26659,z2=0.24531,z3=0.22637,z4=0.22497,z5=0.21326,\rm{and}~{}z6=0.12137$).
The high redshift intergalactic medium (IGM) is traced by the Ly$\alpha$
forest, and most of the baryonic mass in the high redshift Universe resides in
the IGM. At lower redshifts ($z\leq 2$) the IGM is shock-heated in the process
of large-scale structure formation, but most of the low redshift baryons are
believed to remain in the warm-hot IGM (WHIM; Davé et al. (2010)). Mathur et
al. (2003) reported marginal ($2\sigma$) detections of O vii at $z2,z4$ and
$z6$; of O viii at $z6$, and of Ne x at $z4$. Kovács et al. (2019) used the
same Chandra LETG-ACIS-S data and performed stacking analysis to look for O
vii absorption at the redshifts of 17 Ly$\alpha$ absorption systems. They
reported significant ($3.3\sigma$) detection of the O vii line and argued that
the line originates from the WHIM. One of the 17 systems in their sample, at
$z\approx 0.225$, has the smallest impact parameter of 112.5kpc to an
intervening galaxy; they do not discuss whether the O vii absorption could be
from the CGM of this galaxy. Previously, the same absorption system was
studied extensively by Narayanan et al. (2010). They found that the two O vi
absorption systems, at $z=0.22496$ and $z=0.22638$, are associated with the
extended halo of the same spiral galaxy situated at a projected distance of
$116h^{-1}_{71}$kpc (see also Savage et al. (1998)). In this paper, we present
new 1.2 Ms Chandra observations of the H1821+643 sightline and show that the O
vii absorption arises in the hot CGM of the $z\approx 0.225$ galaxy.

##  2 Observations and analysis

New Chandra observations of H1821+643 were made from March, 2020 through
August, 2021. The source was observed with LETG/HRC-S (High Resolution Camera
for Spectroscopy) for 1.2Ms (sequence numbers 601449 and 601495). We analyzed
these data using CIAO (Chandra Interactive Analysis of Observations),
following standard data reduction tools and
threads111https://asc.harvard.edu/ciao/. Since HRC-S does not have clear order
sorting, we included grating orders 1–8 in our analysis and combined the plus
and minus orders. The spectrum showed practically no data beyond 3 keV, so we
analyzed the spectrum in the 0.3–3 keV range. The observed net count rate was
$0.2485\pm 0.0005$ counts/s yielding a total of $2.98\times 10^{5}$
background-subtracted counts. We binned the spectrum by four, to the
LETG/HRC-S resolution of 0.05Å; the absorption lines are not resolved with
Chandra LETG. We also note that the wavelength calibration uncertainty of
LETG/HRC-S has the mean value of about 0.01 Å (120 km s-1at 25Å) with a large
scatter around the mean222https://cxc.harvard.edu/cal/Letg/Hrc_disp/. All the
spectral analysis was performed with XSPEC
v12.12.1333https://heasarc.gsfc.nasa.gov/xanadu/xspec/. The errors are
$1\sigma$, unless noted otherwise.

As noted above, there are six O vi absorption line systems in the sightline to
H1821+643 . The O vii K$\alpha$ line at the rest wavelength of 21.602Å is
expected to be the strongest line in hot plasma (see Mathur et al. (2003);
Mathur (2022)), which is the focus of WHIM or CGM studies. The O vii K$\alpha$
line is redshifted to 27.3608Å for z1, 26.9012 Å for z2, 26.4920 for z3,
26.4618 for z4, 26.2088 for z5, and 24.2238 for z6. The focus of this paper is
the CGM of the galaxy associated with the z4 system at $z=0.22497$ and the z3
system at $z=0.22637$. The z4 O vi absorber is significantly stronger (N(O vi
)$=19.9\pm 1.2\times 10^{13}$ cm-2) than z3 (N(O vi )$=2.4\pm 0.5\times
10^{13}$ cm-2); we will refer to this absorption system as the “z4 system” and
the associated galaxy as the “z4 galaxy” for the purpose of this paper. The
observed wavelength difference of 0.0302 Å corrsponding to the z3 and z4
systems is less than the LETG/HRC-S resolution, thus the two O vii lines would
be blended in the Chandra spectrum.

The 0.3–3.0 keV spectrum of H1821+643 cannot be simply fit with an absorbed
power-law (Mathur et al., 2003). We note that the observed O vii wavelengths
of all the six absorption systems are within the 24–28 Å range, therefore we
restricted our analysis to this range. This enables us to fit the local
continuum with a simple power law, as also done in Lara-DI et al. (2023). We
added Gaussian lines at the locations of the wavelengths of the expected O vii
lines, which were held fixed. The lines are not resolved at the LETG
resolution, therefore the line width was held fixed at a very small value of
$10^{-5}$; the observed line width is thus the instrumental line width. The
free parameters of the initial spectral fit were Galactic column density N(H),
power-law slope and normalization, and the normalization of each Gaussian
line. The result of this fit is shown in Figure 1. The only features clearly
seen in this spectral range are the line corresponding to the "z4 system", and
a marginal line corresponding to the z2 system.

In Figure 2, we show the same fit, but the “unfolded" spectrum is plotted
instead, where the data are deconvolved by the effective area of the
instrument. This is akin to a flat-fielded spectrum in optical/UV. Here the z4
and z2 systems are clearly seen. In Figure 3 we show the normalized spectrum
from 26Å to 27Å, around the z4 line. The flux at the z4 line center is
$2.78\pm 0.33\times 10^{-4}$ photons cm-2 s-1 Å-1 and the continuum flux at
the same wavelength is $4.30\pm 0.97\times 10^{-4}$ photons cm-2 s-1 Å-1. Thus
the flux at the line trough is $4.48\sigma$ below the continuum.

A conventional way to assess the presence of an additional spectral feature is
done through the F-test. We obtain the best-fit $\chi^{2}=45.01$ for 71
degrees of freedom including the z4 line. Without the line, we had
$\chi^{2}=53.89$ for 72 degrees of freedom. Thus the F-test probability for
finding the line feature by chance is $0.05\%$. This shows that the line is
present at 99.95% confidence. The line equivalent width, however, is measured
with a lower significance of $3\sigma$: $\rm EW=0.38\pm 0.13$eV ($21\pm 7$mÅ).
However, it is very important to note that all these measures of significance
or confidence (derived by any of these three methods) are not for blind
searches, but for targeted searches with the O vi prior. Thus even a $3\sigma$
result is a robust result.

Next, we allowed the line wavelength to be free within 0.1Å (two resolution
elements) around the expected z4 line center (26.4618 Å) and refitted the
spectrum. The best-fit line centroid is $26.4385^{+0.009}_{-0.012}$Å. The
best-fit wavelength is thus within half the resolution element of the expected
wavelength.

While the focus of this paper is the z4 system, we note the absorption line at
$26.9012$ Å from the z2 system. The line is marginally detected but is
required by the fit. If we start with the line normalization of zero and re-
fit the spectrum, the best-fit normalization is non-zero. The best-fit
$EW=10.7+^{6.3}_{7.3}$mÅ. The same line is also reported by Mathur et al.
(2003) with $EW=13.9\pm 6.2$mÅ consistent with what we find here. Kovács et
al. (2019) note a $z=0.24568$ galaxy at an impact parameter of $669.6$kpc.
Given the large impact parameter, it is unlikely that the observed absorption
is from the CGM of that galaxy. There might be a closer but fainter galaxy or
the absorption feature may not be real, or it may actually arise from the WHIM
(see Mathur et al. (2003) for details); we have no further information to
choose among these options. We do not discuss this z2 system further.

###  2.1 Combined analysis of LETG- HRC-S and -ACIS data

To obtain better constraints on the O vii absorption line at z4, we reanalyzed
the LETG-ACIS-S data (Mathur et al., 2003) and fitted the 26–27 Å spectrum
simultaneously with the LETG-HRC-S spectrum. The measured EW of the O vii line
is $EW=0.3\pm 0.1$eV ($16.95\pm 5.65$ mÅ), consistent with the measurement
using the LETG-HRC-S spectrum only. This is the observed EW at z4; the rest-
frame EW at the z4 galaxy is, therefore, $EW=13.8\pm 4.6$mÅ. Following
equation 2 in Mathur et al. (2003), we calculate the O vii column density to
be $\rm N(OVII)=4.9\pm 1.6\times 10^{15}cm^{-2}$.

##  3 Discussion

###  3.1 A z=0 line?

In the above section, we showed that a line is clearly present at 26.4618Å.
Assuming this is to be O vii K$\alpha$, we argue that it arises in the CGM of
the “z4 galaxy”. However, could it be another ionic transition at another
redshift? In particular, we need to check whether the observed line feature
could be a z=0 line from the interstellar medium (ISM) or the CGM of the Milky
Way. Indeed, Mathur et al. (2017) showed that the putative $z=0$ O vi line at
$\lambda=22.03$Å from the Milky Way CGM is in fact an O ii line at
$\lambda=22.04$ Å from the ISM, providing a solution to $\approx 15$ year
mystery of the mismatch between the X-ray and UV measured O vi column
densities. Recently, Gatuzz et al. (2023) argued that the putative intervening
O vii absorption lines from the WHIM reported in literature along five
different sightlines are in fact lower-ionization lines from the interstellar
medium of our Galaxy. Therefore, we searched for the line transitions of C, N,
O, Ne, Mg, and Si with rest-wavelengths in the $26-27$Å range following Gatuzz
et al. (2023) and references therein. Gatuzz et al. (2021) report a N v
K$\gamma$ line around $26$Å. However, a stronger N v $K\alpha$ line at
$29.4135$Å is not detected in our spectrum. Therefore we rule out that the
observed line is a $z=0$ N v line. No line from any other element is present
in the wavelength range of interest.

We next searched NIST444https://www.nist.gov/pml/atomic-spectra-database for
lines from any other element in the 26–27Å range. There are possible weak
lines of Si XII, Ar XIII, Ar XIV, and Ca XI in this range, but the stronger
lines of these ions are not detected in our spectrum. We thus rule out that
our observed line at $\lambda=26.4618$Å is any z=0 line.

###  3.2 The CGM of the $z\approx 0.225$ galaxy

Narayanan et al. (2010) studied the CGM of the z3/z4 galaxy extensively in the
UV. They found that the O vi absorption line in the z4 system is broader than
the photoionized lower ions such as Si II and Si III. They concluded that O vi
likely originates in collisionally ionized plasma under non-equilibrium
conditions. They proposed that the observed O vi absorber is analogous to
Galactic O vi high-velocity clouds, produced in the transition region between
the warm phase and the hot ($\rm T>10^{6}$K) corona of the galaxy. The O vi
absorber at z3 has an associated broad Ly$\alpha$ absorber. Narayanan et al.
(2010) conclude that the z3 system traces a cooling condensing fragment in the
galaxy’s hot gaseous halo. Thus, both the z3 and z4 O vi systems predict the
presence of the hot CGM of the host galaxy at $z=0.2256$.

In this paper, we show that the z4 galaxy indeed harbors hot CGM as traced by
the O vii absorption line and the O vii column density is $\rm N(OVII)=4.9\pm
1.6\times 10^{15}cm^{-2}$. Assuming oxygen abundance to be $\rm
A_{O}/A_{H}=8.51\times 10^{-4}$ (Asplund et al., 2009), metallicity of
$Z/Z_{\odot}=0.1$ (for consistency with Narayanan et al., 2010), and
ionization fraction of O vii in the hot CGM to be $f_{OVII}=0.5$ (following
Gupta et al., 2012), we calculate the total column density.

$\rm N_{H}=1.1\times 10^{20}\;cm^{-2}\Big{(}\frac{A_{O}/A_{H}}{8.51\times
10^{-4}}\Big{)}^{-1}\Big{(}\frac{Z/Z_{\odot}}{0.1}\Big{)}^{-1}\Big{(}\frac{f_{OVII}}{0.5}\Big{)}^{-1}$
(1)

The H1821+643 sightline passes at $d=116$ kpc from the galaxy. Narayanan et
al. (2010) have assumed the radius of the halo of the galaxy $R=200$kpc, and
we use the same for the sake of consistency. Thus the pathlength traced by the
O vii absorber through the CGM is $\rm L=2\times\sqrt{(R^{2}-d^{2})}=325.8$
kpc. Given $\rm N_{H}=\mu n_{e}L$, where $\mu=0.8$ is the mean molecular
weight, we calculate the density $n_{e}=1.4\times 10^{-4}cm^{-3}$. The density
we measure is the average density along the pathlength, between the radii $d$
and $R$ of the galaxy. For any density profile monotonically decreasing with
radius, the density would be higher at radii $r<d$ and lower for radii $r>d$.
Thus the measured density is a conservative estimate of the average density of
the entire halo. Using this density, a (conservative) constant density
profile, and the spherical distribution of the hot gas filling the halo out to
the radius R, we calculate the mass of the hot gas in the CGM.

$\rm M_{CGM}=9.1\times
10^{10}\;M_{\odot}\Big{(}\frac{R_{200}}{200kpc}\Big{)}^{2}\Big{(}\frac{N_{H}}{1.1\times
10^{20}cm^{-2}}\Big{)}$ (2)

Thus the mass in the hot CGM is over an order of magnitude larger than the
mass probed the UV systems ($6\times 10^{9}$M⊙; Narayanan et al. (2010)).

The stellar mass of the Milky Way is $4-6\times 10^{10}$M⊙ and the total mass
is $1-2\times 10^{12}$M⊙. We do not know the mass of the $z\approx 0.225$
galaxy, but it is a Milky Way-like galaxy (given $R=200$kpc noted above);
therefore we will assume minimum $M_{\star}=4\times 10^{10}$M⊙ and total mass
$M_{total}=10^{12}$M⊙. The total baryonic mass of the galaxy is
$M_{b}=M_{\star}+M_{CGM}=13\times 10^{10}$M⊙, ignoring contributions from the
ISM and the cooler phases of the CGM. Thus the baryon fraction we measure is
$f_{b}=0.13$, compared to the cosmological $f_{b}=0.157$ (Planck Collaboration
et al., 2016). Note that our measurement has several uncertainties: (1) the
measured density is the average density beyond 116 kpc, with the true average
being larger (depending on the density profile); (2) we have not included
saturation effects (Williams et al., 2005; Gupta et al., 2012); and (3)
metallicity is assumed to be $0.1Z_{\odot}$. The first two of these have
likely lowered the measured baryonic mass, while the third has increased it.
Without knowing the density profile and the metallicity we cannot calculate
the exact total baryonic mass of the halo and without knowing the stellar mass
and halo mass we cannot determine the actual baryon fraction of the galaxy,
but the calculations presented here show that the numbers are reasonable.

Alternatively, we estimate the stellar mass of the galaxy as follows.
Narayanan et al. (2010) have published the B magnitude of the galaxy, but in
order to determine the stellar mass we need infrared magnitudes. We obtained
the WISE W1 magnitude at $3.4\mu m$ from the NASA/IPAC Science Archive (IRSA),
from the AllWISE Source Catalog555 https://irsa.ipac.caltech.edu. From
W1=14.306, we calculated the galaxy luminosity to be $\rm\nu L_{\nu}=8\times
10^{43}erg~{}s^{-1}$ (assuming a $\Lambda$CDM cosmology with $\rm
H_{0}=69.6,\Omega_{m}=0.286~{}and~{}\Omega_{Lambda}=.714$). We used the
stellar mass–$3.4\mu m$ luminosity correlation of Wen et al. (2013) to
calculate the stellar mass of the galaxy $\rm M_{\star}=2.2\times 10^{11}$M⊙.
Coupon et al. (2015) have determined the stellar mass–halo mass correlation
using joint analysis with clustering, lensing, and abundance matching.
Accordingly, we determine the halo mass of our target galaxy to be $\rm
M_{h}=5\times 10^{13}$M⊙. From this halo mass, we calculated the virial radius
of the galaxy $R_{200}=783$kpc. Thus we see that both the mass and the radius
is huge, almost in the range of groups of galaxies. In the density calculation
above, we had assumed the galaxy radius to be 200 kpc. If instead it is 783
kpc, the density would be $\rm\log n_{H}(cm^{-3})\approx-4.33$. The mass in
the hot CGM would then be larger by a factor of
$(\frac{R_{200}}{200kpc})^{2}=15.3$, making $\rm M_{CGM}=1.4\times 10^{12}$M⊙.
Once again, the mass in the hot CGM is significantly higher than the stellar
mass of the galaxy. The baryon fraction, however, would be significantly
smaller $f_{b}=0.03$.

Hydrodynamic simulations of Oppenheimer et al. (2016) predict
temperature–density phase space for a similar halo, with $M_{h}=1.6\times
10^{13}$M⊙ and $R_{200}=486$ kpc (their fig. 3). While there is a small
distribution around the mean, the temperature peaks at $\rm\log T(K)=6.4-6.5$,
and density at $\rm\log n_{H}(cm^{-3})\approx-4.25$. The temperature is in the
range where O vii ionization fraction peaks and the density we calculate is
within their predicted range. This shows that our estimates are consistent
with those from theoretical simulations.

The above sets of calculations show the huge uncertainty in the derived
parameters. We also note that there is an order of magnitude scatter in the
stellar mass–$3.4\mu m$ luminosity correlation of Wen et al. (2013), thus the
stellar mass of our target galaxy could be significantly smaller. The halo
mass is also a strong function of stellar mass (Coupon et al., 2015),
therefore the baryon fraction would also likely depend on the stellar mass,
which itself is highly uncertain. Once again, the calculations presented here
show how the derived parameters depend on assumptions and how uncertain they
are.

###  3.3 Relevance for the CGM studies of the Milky Way

Because of the special vantage point, the CGM of the Milky Way has been
studied in detail with X-ray absorption lines (see the review by Mathur
(2022)). However, because of our location in the disk of the Galaxy, we cannot
directly measure the location of the absorbing gas, or its pathlength. Are the
observed $z=0$ absorption lines truly from the CGM or could they arise in the
interstellar medium or the extra-planar region of the Galaxy? By combining
absorption and emission observations we showed that the MW CGM is diffuse,
extended to over 100 kpc, and massive (Gupta et al., 2012). There is no anti-
correlation of the absorption column density with Galactic latitude $sin(b)$
of the sightline (Gupta et al., 2014; Fang et al., 2015), which would have
been present if the absorption was dominated by the Galactic disk. Nicastro et
al. (2016) observed sightlines to Galactic X-ray binaries to measure the
contribution of the ISM to the absorption column density of O vii and showed
that to be negligible. Thus it is clear that most of the observed column
density of the $z=0$ O vii absorption lines is from the MW CGM, but the
location of the $z=0$ absorbers remains a live question in the literature. In
this paper, we show that a significant amount of hot gas at galactic radii of
116 kpc and larger is present in an external galaxy (which may be MW-like).
This provides strong support for the existence of the extended hot CGM in the
Milky Way (and other spiral galaxies). We also note that the average density
of the hot gas we measure in this external galaxy between the radii of 116kpc
and 200kpc is somewhat smaller than the estimate of average density in the
Milky Way CGM of $\rm n_{e}=2\pm 0.6\times 10^{-4}cm^{-3}$ (Gupta et al.,
2012), as expected.

###  3.4 WHIM in the H1821+643 sightline?

As noted in §1, the sightline to the X-ray bright blazar was observed with
Chandra LETG-ACIS-S for 500ks to look for the elusive WHIM by Mathur et al.
(2003). They specifically looked for O vii absorption lines at the redshifts
of the six O vi absorption systems. Subsequently, this sightline was
extensively studied to find galaxies close to the intervening absorption
systems. Narayanan et al. (2010) reported on the presence of a luminous spiral
galaxy at $z=0.225$ at an impact parameter of $116h^{-1}_{71}$kpc from the
blazar sightline. They showed that both the z3 and z4 systems arise in the
extended halo of this galaxy, probing its CGM. Kovács et al. (2019) used the
same Chandra data of Mathur et al. (2003) to look for the WHIM by stacking the
spectra at the redshifts of 17 intervening Ly$\alpha$ absorption system. They
reported a “statistically significant” ($3.3\sigma$) detection of the WHIM. We
note that the z3 and z4 O vi systems also have associated Ly$\alpha$
absorption (Narayanan et al., 2010), and the $z=0.22489$ Ly$\alpha$ absorber
associated with the z4 system is one of the 17 Ly$\alpha$ absorber systems
used as anchors by Kovács et al. (2019). This absorber also has the smallest
impact parameter of all the Ly$\alpha$ absorber systems. Therefore, it is
highly likely that the stacking was dominated by the $z=0.22489$ absorber.

The new 1.2 Ms data presented in this paper clearly shows O vii absorption
arising in the CGM of the galaxy associated with the z4 system. This, together
with the z2 system, were included in the stacking analysis by Kovács et al.
(2019), dominating the absorption signal. The rest-frame O vii line EW we
measure is $EW=14.3\pm 6.9$mÅ, while that reported by Kovács et al. (2019) is
$EW=4.1\pm 1.3$mÅ; these are consistent with each other within $2\sigma$. If
the measurement by Kovács et al. (2019) is correct, the “true” rest frame EW
will have to be $\sim 1.5\sigma$ lower than our best-fit vale. In any case,
the O vii absorption arises from within the halo radius of a spiral galaxy at
$z=0.225$, therefore it is more accurately characterised as from the CGM of
this galaxy. It is unlikely that it is from the WHIM as claimed by Kovács et
al. (2019).

Figure 1: Chandra LETG-HRC-S spectrum in the 24 to 28 Å range. The locations
of O vii K$\alpha$ line at z2 and z4 are marked. Figure 2: Same as figure 1,
but the unfolded spectrum is plotted here.  Figure 3: Normalized spectrum
between 26Å and 27Å. Once again, we see the O vii $K\alpha$ line redshifted to
$26.4618$Å at the redshift of the $z=0.225$ galaxy.

##  4 Conclusions

We analyzed the 1.2Ms of Chandra LETG-HRC-S data in the sightline to H1821+643
probing the CGM of an intervening galaxy at $z\approx 0.225$, corresponding to
known O vi absorption systems. We detect the O vii K$\alpha$ absorption at the
same redshift with high confidence, tracing the hot CGM of the galaxy. The
presence of such hot CGM was predicted by Narayanan et al. (2010) based on the
properties of the UV absorbers. In addition to the $z\approx 0.167$ galaxy in
the sightline to PKS$0405-123$ and the “average” galaxy detected by stacking
analysis of Lyman limit systems (§1), this is the only other external galaxy
in which the hot CGM is detected with absorption line spectroscopy. We argue
that the previously reported discovery of the O vii absorption line from the
WHIM in the sightline to H1821+643 is in fact from the CGM of a luminous
spiral galaxy, not from the WHIM.

## Acknowledgements

SM is grateful for the grant provided by the National Aeronautics and Space
Administration through Chandra Award Number AR0-21016X issued by the Chandra
X-ray Center, which is operated by the Smithsonian Astrophysical Observatory
for and on behalf of the National Aeronautics Space Administration under
contract NAS8-03060. S.M. is also grateful for the NASA ADAP grant
80NSSC22K1121. S.D. acknowledges support from the KIPAC Fellowship of Kavli
Institute for Particle Astrophysics and Cosmology, Stanford University. AG
gratefully acknowledges support through the NASA ADAP grant 80NSSC18K0419. YK
acknowledges support from UNAM PAPIIT grant IN102023.

## Data Availability

The scientific results reported in this article are based on observations made
by the Chandra X-ray Observatory (all the ObsIDs of Sequence Numbers: 601449,
601495, 700376). All the data are publicly available in the Chandra X-ray
Center (CXC) archive. This research has made use of the software provided by
CXC in the application package CIAO.

## References

  * Asplund et al. (2009) Asplund M., Grevesse N., Sauval A. J., Scott P., 2009, ARA&A, 47, 481
  * Bhattacharyya et al. (2023) Bhattacharyya S., Das S., Gupta A., Mathur S., Krongold Y., 2023, arXiv e-prints, p. arXiv:2208.07863
  * Coupon et al. (2015) Coupon J., et al., 2015, MNRAS, 449, 1352
  * Das et al. (2019a) Das S., Mathur S., Nicastro F., Krongold Y., 2019a, ApJ, 882, L23
  * Das et al. (2019b) Das S., Mathur S., Gupta A., Nicastro F., Krongold Y., Null C., 2019b, ApJ, 885, 108
  * Das et al. (2019c) Das S., Mathur S., Gupta A., Nicastro F., Krongold Y., 2019c, ApJ, 887, 257
  * Das et al. (2020) Das S., Mathur S., Gupta A., 2020, ApJ, 897, 63
  * Das et al. (2021) Das S., Mathur S., Gupta A., Krongold Y., 2021, ApJ, 918, 83
  * Davé et al. (2010) Davé R., Oppenheimer B. D., Katz N., Kollmeier J. A., Weinberg D. H., 2010, MNRAS, 408, 2051
  * Fang et al. (2006) Fang T., Mckee C. F., Canizares C. R., Wolfire M., 2006, ApJ, 644, 174
  * Fang et al. (2015) Fang T., Buote D., Bullock J., Ma R., 2015, ApJS, 217, 21
  * Faucher-Giguere & Oh (2023) Faucher-Giguere C.-A., Oh S. P., 2023, arXiv e-prints, p. arXiv:2301.10253
  * Galeazzi et al. (2007) Galeazzi M., Gupta A., Covey K., Ursino E., 2007, ApJ, 658, 1081
  * Gatuzz et al. (2021) Gatuzz E., García J. A., Kallman T. R., 2021, MNRAS, 504, 4460
  * Gatuzz et al. (2023) Gatuzz E., García J. A., Churazov E., Kallman T. R., 2023, MNRAS, 521, 3098
  * Gupta et al. (2009) Gupta A., Galeazzi M., Koutroumpa D., Smith R., Lallement R., 2009, ApJ, 707, 644
  * Gupta et al. (2012) Gupta A., Mathur S., Krongold Y., Nicastro F., Galeazzi M., 2012, ApJ, 756, L8
  * Gupta et al. (2014) Gupta A., Mathur S., Galeazzi M., Krongold Y., 2014, Ap&SS, 352, 775
  * Gupta et al. (2023) Gupta A., Mathur S., Kingsbury J., Das S., Krongold Y., 2023, Nature Astronomy,
  * Henley & Shelton (2008) Henley D. B., Shelton R. L., 2008, ApJ, 676, 335
  * Henley et al. (2007) Henley D. B., Shelton R. L., Kuntz K. D., 2007, ApJ, 661, 304
  * Kovács et al. (2019) Kovács O. E., Bogdán Á., Smith R. K., Kraft R. P., Forman W. R., 2019, ApJ, 872, 83
  * Lara-DI et al. (2023) Lara-DI A. J., Krongold Y., Mathur S., Das S., Gupta A., 2023, ApJ, 946, 55
  * Mathur (2022) Mathur S., 2022, in , Handbook of X-ray and Gamma-ray Astrophysics. Edited by Cosimo Bambi and Andrea Santangelo. p. 92, doi:10.1007/978-981-16-4544-0_112-1
  * Mathur et al. (2003) Mathur S., Weinberg D. H., Chen X., 2003, ApJ, 582, 82
  * Mathur et al. (2017) Mathur S., Nicastro F., Gupta A., Krongold Y., McLaughlin B. M., Brickhouse N., Pradhan A., 2017, ApJ, 851, L7
  * Mathur et al. (2021) Mathur S., Gupta A., Das S., Krongold Y., Nicastro F., 2021, ApJ, 908, 69
  * Miller & Bregman (2015) Miller M. J., Bregman J. N., 2015, ApJ, 800, 14
  * Narayanan et al. (2010) Narayanan A., Savage B. D., Wakker B. P., 2010, ApJ, 712, 1443
  * Nicastro et al. (2002) Nicastro F., et al., 2002, ApJ, 573, 157
  * Nicastro et al. (2016) Nicastro F., Senatore F., Krongold Y., Mathur S., Elvis M., 2016, ApJ, 828, L12
  * Nicastro et al. (2023) Nicastro F., et al., 2023, arXiv e-prints, p. arXiv:2302.04247
  * Oegerle et al. (2000) Oegerle W. R., et al., 2000, ApJ, 538, L23
  * Oppenheimer et al. (2016) Oppenheimer B. D., et al., 2016, MNRAS, 460, 2157
  * Planck Collaboration et al. (2016) Planck Collaboration et al., 2016, A&A, 594, A13
  * Savage et al. (1998) Savage B. D., Tripp T. M., Lu L., 1998, AJ, 115, 436
  * Savage et al. (2010) Savage B. D., et al., 2010, ApJ, 719, 1526
  * Smith et al. (2007) Smith R. K., et al., 2007, PASJ, 59, 141
  * Snowden et al. (2000) Snowden S. L., Freyberg M. J., Kuntz K. D., Sanders W. T., 2000, ApJS, 128, 171
  * Tripp et al. (2000) Tripp T. M., Savage B. D., Jenkins E. B., 2000, ApJ, 534, L1
  * Tumlinson et al. (2017) Tumlinson J., Peeples M. S., Werk J. K., 2017, ARA&A, 55, 389
  * Wen et al. (2013) Wen X.-Q., Wu H., Zhu Y.-N., Lam M. I., Wu C.-J., Wicker J., Zhao Y.-H., 2013, MNRAS, 433, 2946
  * Williams et al. (2005) Williams R. J., et al., 2005, ApJ, 631, 856


# Metapaths-guided Neighbors-aggregated Network for Heterogeneous Graph
Reasoning

Bang Lin  Alibaba Group<EMAIL_ADDRESS>,  Xiuchong Wang  Alibaba
Group<EMAIL_ADDRESS>,  Yu Dong  Alibaba Group
<EMAIL_ADDRESS>,  Chengfu Huo  Alibaba Group chengfu.huocf@alibaba-
inc.com ,  Weijun Ren  Alibaba Group<EMAIL_ADDRESS>and  Chuanyu Xu
Alibaba Group<EMAIL_ADDRESS>
(2018; 2021)

###### Abstract.

Most real-world datasets are inherently heterogeneous graphs, which involve a
diversity of node and relation types. Heterogeneous graph embedding is to
learn the structure and semantic information from the graph, and then embed it
into the low-dimensional node representation. Existing methods usually capture
the composite relation of a heterogeneous graph by defining metapath, which
represent a semantic of the graph. However, these methods either ignore node
attributes, or discard the local and global information of the graph, or only
consider one metapath. To address these limitations, we propose a Metapaths-
guided Neighbors-aggregated Heterogeneous Graph Neural Network(MHN) to improve
performance. Specially, MHN employs node base embedding to encapsulate node
attributes, BFS and DFS neighbors aggregation within a metapath to capture
local and global information, and metapaths aggregation to combine different
semantics of the heterogeneous graph. We conduct extensive experiments for the
proposed MHN on three real-world heterogeneous graph datasets, including node
classification, link prediction and online A/B test on Alibaba mobile
application. Results demonstrate that MHN performs better than other state-of-
the-art baselines.

Heterogeneous graph; Deep learning; Graph embedding

††copyright: acmcopyright††journalyear: 2018††doi:
10.1145/1122445.1122456††journalyear: 2021††copyright:
rightsretained††conference: The 1st International Workshop on Machine
Reasoning; March 12, 2021; Jerusalem, Israel††booktitle: Proceedings of the
1st International Workshop on Machine Reasoning (MRC’21), March 12, 2021,
Jerusalem, Israel††ccs: Mathematics of computing Graph algorithms††ccs:
Computing methodologies Machine learning

##  1\. Introduction

Real-world datasets usually exist in the form of graph structure, such as
social networks[1], citation networks[2], knowledge graphs[3], especially
recommendation systems[4] where nodes and edges represent objects and
relationships, respectively. Taking an example, users and items in
recommendation system can be represented as nodes while relationships such as
purchases and clicks can be represented as edges, so that we can turn the
recommendation dataset into a graph structure. Because graph is a high-
dimensional non-Euclidean structure, it is difficult to model by traditional
machine learning methods. Therefore, it is helpful to represent nodes by low-
dimensional dense vectors, which can be the input of other machine learning
models.

There have been many graph embedding methods, which are divided into two
different solutions generally. For methods based on random walk, such as
Deepwalk[5], Node2vec[6] and so on, sequences generated by random walk are fed
into the skip-gram model to learn node embedding. However, with the rapid
development of neural networks, methods based on graph neural network(GNN)
have become more widely used, which learn the node embedding using specially
designed neural layers. Methods like GCN[7], GAT[8], GraphSAGE[9] and other
variants, they perform convolution operations on the graph or apply attention
mechanism to generate more reasonable node representations.

Although the above methods have achieved state-of-the-art results in graph
embedding learning, their input is homogeneous graph, which consist one edge
type and one node type. Many real-world datasets are heterogeneous graphs,
which consist of various types of nodes and edges. For example, an E-commerce
recommendation graph consists at least two types of nodes, namely user and
item. At the same time, different types of nodes have different attributes.
Attributes of user node may include age, sex and address while item node
attributes may consist of price, brand, category, and so on. Due to the
heterogeneity of graphs, it is a challenge for GNNs to encoder the complex
information into low-dimensional vectors.

Since metapath can extract relations between different types of nodes in
heterogeneous graphs, most of heterogeneous graph embedding methods are based
on metapath. Metapath is an ordered sequence of node and edge types, which
represents a semantic space of the graph. For example, in E-commerce
recommendation graph, metapath user-item-user means the User-based
collaborative filtering, while item-user-item means the Item-based
collaborative filtering. Also, metapath can guide the way to sample the
heterogeneous graph and obtain neighbors.

Currently, there are many methods using metapath to generate node
representation of heterogeneous graph, but they still have some limitations.
(1) Some methods do not make use of the attributes of nodes, resulting in the
lack of rich information, such as Metapath2vec[10], HERec[11]. (2) Some
methods do not consider local and global information of nodes, which are
important to the generation of node embedding(e.g. HAN[12], GATNE[13]). (3)
Although nodes in different semantics have different meanings, some methods
adopt one metapath to embed the heterogeneous graph, ignoring the importance
of multiple semantic spaces(e.g. Metapath2vec[10], EGES[14]).

In order to address these limitations, we propose a Metapaths-guided
Neighbors-aggregated Heterogeneous Graph Neural Network(MHN) model for
heterogeneous graph embedding learning. Through applying node base embedding
by attributes transformation, aggregation within one metapath and aggregation
among matapaths, MHN can address these limitations. Specifically, MNH first
adopts type-specific linear transformations to project attributes of different
types of nodes, aiming to transform them into the same latent vector space.
Then, MHN applies metapath-guided neighbors aggregation for each metapath.
During extracting local information from BFS neighbors and global information
from DFS neighbors, MHN weighted sums them and obtains the representation of
target node under the current semantic. In this way, MHN captures structural
and semantical information of the heterogeneous graph. Finally, MHN conducts
aggregation among metapaths using the attention mechanism, with the aim of
fusing latent vectors obtained from multiple metapaths into the final node
embedding. Therefore, MHN can learn the comprehensive semantics in the
heterogeneous graph.

The contribution of this paper lies in three aspects:

  * •

We propose an end-to-end model MHN for heterogeneous graph embedding, which is
a novel metapath aggregated graph neural network.

  * •

MHN extracts local and global information under the guidance of a single
metapath, and applies attention mechanism to fuse different semantic vectors.
MHN supports both supervised and unsupervised learning.

  * •

We conduct extensive experiments on the DBLP dataset for node classification
task, as well as on the Amazon and Alibaba datasets for link prediction task
to evaluate the performance of the proposed model. Moreover, we conduct online
A/B test on Alibaba mobile application. Results show that representations
generated by MHN performs better than other state-of-the-art methods
consistently.

The rest of this paper is organized as follows. Section 2 introduces the
related work. Section 3 describes some preliminary knowledge. Then we proposed
the heterogeneous graph embedding method in Section 4. Experiments and
analysis are shown in Section 5. Finally, we conclude the paper in Section 6.

##  2\. Related Work

In this section, we will review the related studies about graph representation
learning related to the proposed model. These methods are organized into four
subsections: Homogeneous Graph Embedding methods, Homogeneous GNN methods,
Heterogeneous Graph Embedding methods and Heterogeneous GNN methods.

Homogeneous Graph Embedding methods. The goal of these methods is to learn a
low-dimensional representations for each node from homogeneous graph, which
can be used for many downstream task directly. DeepWalk[5] is a model for
learning latent representation, which applies random walk to obtain node
sequences and feeds them into skip-gram model to generate representations.
LINE[15] learns node representations on large-scale graph, which summaries
local and global information through first-order and second-order proximities.
Node2vec[6] designs a biased random walk to explore diverse neighborhoods and
maximize the likelihood of preserving network neighborhoods of nodes. SDNE[16]
applies an autoencoder structure to optimize both the first-order and second-
order similarities.

Homogeneous GNN methods. These methods are mainly built by homogeneous graph
convolution and can be used for both supervised and unsupervised learning.
GCN[7] generates the node embedding by graph convolution, which is performed
in the graph Gourier domain. GAT[8] introduces the attention mechanism into
the graph convolution, and assigns different weights to neighboring nodes to
update the node representation. GraphSage[9] is a inductive learning method.
By training the aggregation function, it can merge features of neighborhoods
and generate the target node embedding.

Heterogeneous Graph Embedding methods. Unfortunately, most of above studies
focus on the homogeneous graph and cannot be used directly in heterogeneous
graph. Nowadays, there are more and more studies about heterogeneous graph
embedding. Metapath2vec[10] proposes to use metapath guided random walk to
sample the heterogeneous graph and obtain several node sequences. EGES[14] is
proposed to solve above problem. Through attention mechanism, it can merge
attribute information into node embedding, which have achieved good
improvement in CTR prediction task. HIN2vec[17] captures the rich semantics
embedded in heterogeneous graph by predicting whether there is a metapath
between nodes.

Heterogeneous GNN methods. Due to the complexity of heterogeneous graph,
homogeneous GNN methods cannot be applied directly. There are many researches
on how to introduce graph convolution into heterogeneous graph. HAN[12]
proposes a node-level attention layer to aggregate neighbors of target node
features and a semantic-level attention layer to merge different semantic
representations. GATNE[13] solves the problem of embedding learning for the
heterogeneous graph with attributes. HERec[11] proposes an embedding method
for heterogeneous graph and applies to the recommendation scene by matrix
factorization.

However, heterogeneous graph embedding methods introduced above have the
limitation of ignoring the local and global information. Although they have
achieved some results in several datasets, we believe that there is still room
for improvement by fully utilizing the information, which promotes us to study
the optimal method of embedding for heterogeneous graph.

##  3\. PRELIMINARIES

In this section, we give definitions of important terms related to
heterogeneous graph and show them in Figure 1.

Definition 3.1 Heterogeneous graph[18]. A heterogeneous graph is denoted as a
graph $G=(\mathcal{V},\epsilon)$, consisting of a node set $\mathcal{V}$ and a
link set $\epsilon$, which is also associated with a node type mapping
function $\varphi:\mathcal{V}\xrightarrow{}\mathcal{A}$ and a link type
mapping function $\psi:\epsilon\xrightarrow{}\mathcal{R}$. $\mathcal{A}$ and
$\mathcal{R}$ denote the sets of predefined node types and link types, where
$|\mathcal{A}|+|\mathcal{R}|>2$.

Example. As shown in Figure 1(a), we construct a heterogeneous graph to model
the E-commerce. It consists of two type of nodes(User($U$) and Item($I$)) and
two relations, which are user click item relation(u-i) and the similarity of
items relation(i-i).

Definition 3.2 Metapath[19]. A metapath $p$ is defined as a path in the form
of
$p=A_{1}\xrightarrow{R_{1}}A_{2}\xrightarrow{R_{2}}A_{3}\cdots\xrightarrow{R_{l}}A_{l+1}$,
which describes a composite relation $R=R_{1}\circ R_{2}\cdots R_{l}$ between
objects $A_{l}$ and $A_{l+1}$, where $\circ$ denotes the composition operator
on relations. Different metapaths represent different semantics[20].

Definition 3.3 Metapath instance[21]. Given a metapath $p$ of a heterogeneous
graph, we can sample the graph under the guidance of $p$ and obtain several
node sequences, which is defined as metapath instance.

Example. As is shown in Figure 1(c), under the guidance of metapath
$p=\\{\textit{U-I-I-U}\\}$, we can sample the graph and get two metapath
instances $user1-item1-item2-user2$ and $user1-item3-item4-user3$.

Definition 3.4 Metapath based BFS Neighbors. Given a node $u$ and a metapath
$p$ in a heterogeneous graph, we can sample the the metapath and obtain
metapath instance for $u$, which is denoted as $P(u)$. Metapath based BFS
Neighbors $N_{u}^{p}$ of node $u$ is defined as the set of nodes which connect
to the node $u$ directly from $P(u)$. Note that the node’s BFS neighbors does
not include itself.

Example. Taking Figure 1(d) as an example, given the metapath
$p=\\{\textit{U-I-I-U}\\}$, the metapath based BFS neighbors of $user1$ is
$\\{item1,item3\\}$ because we can get two metapath instances. Obviously,
metapath based BFS neighbors can exploit the local information of the graph
because these neighbors connect to target node directly.

Definition 3.5 Metapath based DFS Neighbors. Given a node $u$ and a metapath
$p$ in a heterogeneous graph, after sampling the graph and get metapth
instance $P(u)$, we can randomly choose a node sequence $t\in P(u)$. Metapath
based DFS Neighbors $M_{u}^{p}$ is defined as the set of nodes that appears on
node sequence $t$. Note that the node’s DFS neighbors dose not include the
first two nodes.

Example. Taking Figure 1(d) as an example, given a metapath $p=\\{\textit{U-I-
I-U}\\}$, we can randomly choose a node sequence
$\\{user1-item1-item2-user2\\}$ from metapath instances. According to the
definition, we remove the first two nodes and obtain the metapath based DFS
neighbors of $user1$ is $\\{item2,user2\\}$. Compared with BFS neighbors, DFS
neighbors focus on the global information.

Definition 3.6 Heterogeneous Graph Embedding. Given a heterogeneous graph
$G=\\{\mathcal{V},\epsilon\\}$, heterogeneous graph embedding is the task to
learn the $d$-dimensional node representations $z_{u}\in\mathbb{R}^{d},\forall
u\in\mathcal{V}$, which can capture the structural and semantic information of
the heterogeneous graph, where $d\ll|\mathcal{V}|$.

Figure 1: Illustration of definitions. (a) A heterogeneous graph with two
types of nodes(i.e., users, items). (b) An example of metapath, User-Item-
Item-User(UIIU). (c) Metapath instances of the UIIU. (d) The metapath based
BFS and DFS neighbors of the UIIU

##  4\. THE PROPOSED MODEL

In this section, we present a metapath guided Heterogeneous Graph Embedding
Method, called MHN.

In order to make full use of node attributes and structure information of HIN,
the proposed MHN model consists of three major components as is shown in
Figure 2. Firstly, we propose a node embedding representation method combining
node attributes. Then, we propose an attention based method to aggregate local
and global information of HIN under a single semantic space. Finally, we
propose a fusion model to merge the node embeddings under multiple semantics.
We will present detailed illustration of the proposed model next.

###  4.1. Node Base Embedding

For large-scale networks, node id represents the node directly, which has a
great impact on the node embedding. For example, Deepwalk[5] and
Metapath2vec[10] feed node id into network to learn node embedding directly.
Therefore, we apply a embedding lookup layer to get embedding from id. We have

(1) $h_{u}^{id}=W_{e}\cdot u$

where $W_{e}\in\mathbb{R}^{|\mathcal{V}|\times d}$ is the parameter matrix,
$u$ is the id of node, $h_{u}^{id}$ is the latent vector of the node. The role
of this layer is to obtain the corresponding vector according to the node id.
The parameter matrix $W_{e}$ is updated during the training process.

In real world graph, nodes are commonly attributed. Because attributes
represent the information of node, so it is important for heterogeneous graph.
For example, the information of item contains characteristics such as brand,
price, etc, which need to be reflected in node embedding. However, different
kinds of node may have unequal feature dimension. Even for different types of
nodes with the same feature dimension, their features have different meanings.
So we can not simply use a matrix to transform attributes. Therefore, we need
to design a method to map different types of node features into the same
vector space.

In MHN, we multiple transformation matrices to map different types of node
attributes into the same space. For node $u\in\mathcal{V}_{A}$, we have

(2) $h_{u}^{att}=W_{A}\cdot x_{u}$

where $W_{A}$ is the parametric weight matrix for type A’s nodes, $x_{u}$ is
the feature vector of node $u$, $h_{u}^{att}$ is the attribute transformed
latent vector of node $u$.

Considering id and attributes, we can finally obtain the representation of the
node by average these two vectors:

(3) $h_{u}=pooling(h_{u}^{id},h_{u}^{att})$

After applying these options, we can get the node latent vector containing id
and attribute information in the same dimension. Then we will explore how to
aggregate under the guidance of metapath.

###  4.2. Aggregation Within Metapath

Given a single metapath $p_{i}\in\mathcal{P}$, the aggregation within metapath
learns the local and global information through sampling the target node $u$
by BFS and DFS. Firstly, we sample the heterogeneous graph under the guidance
of $p_{i}$ and get some paths started from $u$. Then, we let $N_{u}^{p_{i}}$
denote the BFS neighbors of $u$ under the metapath $p_{i}$. Through the
function $f_{\theta}$, we can encode the neighbors and obtain the
$h_{u,p_{i}}^{BFS}$.

(4) $h_{u,p_{i}}^{BFS}=f_{\theta}(h_{v},v\in N_{u}^{p_{i}})$

where $f_{\theta}$ is the encoder function. We exam three functions:

  * •

MEAN encoder This function takes the mean of all the neighbors, thinking that
all neighbors have the same contribution.

(5) $h_{u,p_{i}}^{BFS}=MEAN(h_{v},v\in N_{u}^{p_{i}})$

  * •

Weighted encoder This function assigns different weights to neighboring nodes
through $\beta$.

(6) $h_{u,p_{i}}^{BFS}=SUM(\beta\cdot[h_{v},v\in N_{u}^{p_{i}}])$

  * •

Non-linear encoder The above two functions focus on the linear aggregation,
which has limited expressive power in modeling complex relations. So we
propose a non-linear function to enhance the representation of the relations
through parameter matrix $W\in\mathbb{R}^{|h^{{}^{\prime}}\times
h^{{}^{\prime}}}$, which is updated during the process of training.

(7) $h_{u,p_{i}}^{BFS}=\sigma(W\cdot[h_{v},v\in N_{u}^{p_{i}}])$

Where $\sigma()$ is non-linear function, i.e., sigmoid or relu.

Similarity, with the DFS neighbors of $u$ under the metapath $p_{i}$, we can
encode $v\in M_{u}^{p_{i}}$ and obtain $h_{u,p_{i}}^{DFS}$.

After encoding the BFS and DFS information into vector representations, we
adopt a simple attention mechanism to weighted sum two vectors related to
target node $u$. The key idea is that BFS neighbors and DFS neighbors have
different impacts on node representation. We can model this by learning a
normalized importance weight $[\alpha_{1},\alpha_{2}]$:

(8) $\begin{split}e_{1},e_{2}&=h_{u}^{T}\cdot h_{u,p_{i}}^{BFS},h_{u}^{T}\cdot
h_{u,p_{i}}^{DFS}\\\
\alpha_{1},\alpha_{2}&=\frac{e^{e_{1}}}{e^{e_{1}}+e^{e_{2}}},\frac{e^{e_{2}}}{e^{e_{1}}+e^{e_{2}}}\\\
h_{u}^{p_{i}}=&\alpha_{1}\cdot h_{u,p_{i}}^{BFS}+\alpha_{2}\cdot
h_{u,p_{i}}^{DFS}\end{split}$

where $h_{u}$ is the representation of node $u$, $\alpha_{1}$ and $\alpha_{2}$
represents the relevance of target node between BFS information and DFS
information.

In general, given the heterogeneous graph $G=(\mathcal{V},\epsilon)$, node
attributes $x_{u},\forall u\in V$ and a set of metapaths
$\mathcal{P}=\\{p_{1},…,p_{|\mathcal{P}|}\\}$, aggregation within metapath of
MHN generates $M$ metapath guided vectors for target node $u$, denoted as
{$h_{u}^{p_{1}},…,h_{u}^{p_{|}\mathcal{P}|}$}. Each $h_{u}^{p_{i}}$ can be
interpreted as the representation of $p_{i}$ metapath instance of node u,
which reflects the semantic information of node $u$ under the metapah $p_{i}$.

Figure 2: The overall structure of proposed method MHN. (a) Sampling the
heterogeneous graph and obtain metapath instances. (b) Encode BFS and DFS
neigbors to summary local and global information, and aggregate them through
weighted summation. (c) Calculate normalized attention weight for each
metapath and generate embedding of node $u$. (d) Design the loss according to
the downstream task and end-to-end optimize the model.

###  4.3. Aggregation Among Metapaths

After aggregating DFS and BFS information to generate the final representation
under a single metapath, we need to merge these different semantic information
revealed by metapaths into a embedding vector. For $\forall u\in\mathcal{V}$,
we have $|M|$ latent embeddings $\\{h_{u}^{p_{1}},…,h_{u}^{p_{M}}\\}$, where
$M$ is the number of metapaths and $M=|\mathcal{P}|$. In order to obtain the
final embedding, we assign different weights to different metapaths through
the attention mechanism. The operation is reasonable because the optimization
object may focus on different semantics.

We apply the attention mechanism to merge mebeddings of node $u$ under
different semantics as follows:

(9) $\begin{split}e_{p_{i}}&=q^{T}\cdot h_{u}^{p_{i}}\\\
\beta_{p_{i}}&=\frac{e^{e_{p_{i}}}}{\sum_{p\in\mathcal{P}}e^{p}}\\\
h_{u}&=\sum_{p_{i}\in\mathcal{P}}\beta_{p_{i}}\cdot h_{u}^{p_{i}}\end{split}$

where $q$ is the parameterized attention vector which is updated in
backpropogation, $\beta_{p_{i}}$ be interpreted as the importance of metapath
$p_{i}$.

Attention mechanism can also be extended to multi-heads self attention, which
helps to stabilize the learning process and reduce the high variance. We first
form all the embeddings of node $u$ into matrix $H_{u}$ of shape $[M,d]$,
where $M$ is the number of embeddings and $d$ is the embedding dimension. Then
we calculate self-attention output under each head. Finally, we concatenate
the output of each head as the embedding of node. Taking head 1 as an example,
the calculating process is as follows:

(10) $\begin{split}Q_{1},K_{1},V_{1}&=H_{u}\cdot W^{Q_{1}},H_{u}\cdot
W^{K_{1}},H_{u}\cdot W^{V_{1}}\\\ h_{u,1}&=softmax(\frac{Q_{1}\cdot
K_{1}}{\sqrt{d}})\cdot V_{1}\\\
h_{u}&=concatenate_{k=1}^{K}h_{u,k}\end{split}$

where $W^{Q_{0}},W^{K_{0}},W^{V_{0}}\in\mathbb{R}^{d\times\frac{d}{K}}$, $K$
is the number of heads, $softmax=e^{i}/\sum_{j}e^{j}$, $d$ is the embedding
size.

At last, we apply a fully connected layer to enhance the nonlinear fitting
ability of the network and the output is the final embedding of node $u$:

(11) $z_{u}=\sigma(W\cdot h_{u})$

###  4.4. Metapaths Generation

When using methods based on metapaths for heterogeneous graph embedding, we
usually need to handcraft some metapaths which are adopted to sample the
graph. However, it is not trivial for human to find useful metapaths in a
complex heterogeneous graph with multiple node or edge types. Therefore, we
need to design an automatic generation method of metapath that does not rely
on manual intervention, which can generate the most useful metapaths and
sample as many nodes as possible.

MST[25] is proposed to select metapaths by using maximal spanning tree, which
is instructive but ignore the applicability of metapaths. We propose a three
stage approach to generate reasonable metapaths from heterogeneous graph
automatically. In the first stage, we perform random walks on heterogeneous
graph under a certain length and obtain lots of metapaths instances. Secondly,
through node type mapping and rule constraints, we can get hundreds of
metapaths. According to unique demand, we can design scoring function and rank
these metapaths to get the top K highest. Take Alibaba dataset as an example,
we generate 4 million node sequences by setting sequence length to 10 and
sampling 5 instances for each node. After filtering through rules, e.t. all
node types must appear in the node sequence, we get almost 400 candidate
metapaths. Due to the goal of training more nodes of video type, we design
scoring formula in Eq. (12)

(12) $score(i)=\frac{logc(i)}{i.count(u)/i.count(v)}$

where $c(i)$ represents the instances sampled by the i’th metapath,
$i.count(u)$ and $i.count(v)$ means the number of user and item in the i’th
metapath.

###  4.5. Training

After finishing the above components, we generate the embedding of each node,
which can be applied in different downstream tasks. According to whether there
are labels of data, we mainly divide the training process into two paradigms,
supervised learning and unsupervised learning.

For supervised learning with node labels, we minimize the cross entropy loss
and update the network parameters through backpropagation and gradient
descent. The cross entropy loss of multi-classification for supervised
learning is:

(13)
$L=-\frac{1}{|\mathcal{V}|}\sum_{u\in\mathcal{V}}\sum_{c=1}^{C}y_{u,c}\cdot
logp_{u,c}$

where $\mathcal{V}$ is the set of training nodes, $C$ is the number of
classes, $y_{u,c}$ is 1 if the label of $u$ is $c$ else 0, $p_{u,c}$ is the
probability that $u^{{}^{\prime}}$s label belongs to $c$ obtained by model.

For unsupervised learning without node labels, we can optimize the model by
minimizing the following nce-loss function through negative sampling:

(14) $L=-\sum_{(u,v)\in S}log\sigma(z_{u}^{T}\cdot
z_{v})-\sum_{(u^{{}^{\prime}},v^{{}^{\prime}})\in
S^{-}}log\sigma(-z_{u^{{}^{\prime}}}^{T}\cdot z_{v^{{}^{\prime}}})$

where $\sigma(\cdot)$ is the sigmoid funchtion, $S$ is the positive node
pairs, $S^{-}$ is the negative node pairs.

Through above model, we can not only aggregate the DFS and BFS information
within a single metapath of the HIN, but also merge the different semantics
represented by metapaths into the final embedding. The algorithm is shown in
Algorithm1.

Algorithm 1 MHN forward propagation

Input: The heterogeneous graph $G=(\mathcal{V},\epsilon)$

node features $\\{x_{u},\forall u\in\mathcal{V}\\}$,

node types $\mathcal{A}=(A_{1},…,A_{|\mathcal{A}|})$,

metapaths set $\mathcal{P}=\\{p_{1},…,p_{|\mathcal{P}|}\\}$

Output: The node embeddings $\\{z_{u},\forall u\in\mathcal{V}\\}$

1: for each node type $A\in\mathcal{A}$ do

2: for node $u\in\mathcal{V}_{A}$ do

3: Get node id information $h_{u}^{id}$ and attributes transformation
$h_{u}^{att}=W_{A}\cdot x_{u}$

4: Calculate node representation $h_{u}=mean(h_{u}^{id}+h_{u}^{att})$

5: for metapath $p\in\mathcal{P}_{A}$ do

6: Aggregate nodes in $N_{u}^{p}$, $M_{u}^{p}$ to obtain vectors
$h_{u,p}^{BFS}$, $h_{u,p}^{DFS}$

7: Calculate the weight $\alpha_{1},\alpha_{2}$ for two vectors

8: Obtain $h_{u}^{p}=\alpha_{1}\cdot h_{u,p}^{BFS}+\alpha_{2}\cdot
h_{u,p}^{DFS}$

9: end for

10: Calculate the weight $\beta_{p}$ for each metapath $p\in P_{A}$

11: Merge the embeddings from all metapths:

12: $h_{u}=\sum_{p\in\mathcal{P}_{A}}\beta_{p}\cdot h_{u}^{p}$

13: end for

14: end for

15: $z_{u}=\sigma(W_{0}\cdot h_{u}),\forall u\in\mathcal{V}$

16: return $z_{u}$

##  5\. experiments

In this section, we present several experiments to demonstrate the
effectiveness of the model we proposed in this paper. We verify the model on
both offline and online datasets.

###  5.1. Datasets

In order to evaluate the performance of MHN as compared to state-of-the-art
baselines, we adopt two widely used heterogeneous graph datasets and collect a
real-world dataset from Alibaba mobile application from Android and IOS
online. Specifically, the DBLP dataset is used in the experiments for node
classification and visualization. Amazon and Alibaba datasets are used in the
experiment for link prediction. The details of these datasets are shown in
Table 1.

  * •

DBLP is a computer science bibliography website, which we adopt a subset of
DBLP extracted by [23]. The heterogeneous graph contains 4057 author nodes,
14328 paper nodes, 20 conference nodes, 19645 pa(paper to author) links and
14328 pc(paper to conference) links. These nodes are divided into four
classes(Database, Data Mining, Artificial Intelligence and Information
Retrieval). Paper’s feature is made by its terms. Author’s and publication’s
feature is described by a bag-of-words representation of their papers’ terms.
For supervised learning tasks, we divide author nodes into training,
validation, test sets of 3245(80.00%), 406(10.01%), 406(10.01%).

  * •

Amazon includes product metadata and links between products. We adopt a subset
of Amazon extracted by [24], in which we only use the product metadata of
Electronics category. We build a heterogeneous graph including the co-viewing
and co-purchasing links between products, and the product attributes include
the price, sales-rank, brand and category with one-hot processing. For
unsupervised learning tasks, we divide the dataset into training, validation,
test sets of 3475(74.46%), 398(8.53%), 794(17.01%).

  * •

Alibaba consists of four types of links including user-click-item, user-click-
video, similarity relation between items, parallelism relation between item
and video with three node types user, item, video, which is sampled from the
log of Alibaba mobile application. We build a heterogeneous graph by sampling
several active users and their behaviors with items and videos. Under the
guidance of section 4.4, we generate three metapaths, who’s sampled nodes can
cover 96% all nodes. For unsupervised learning tasks, we divide the dataset
into training, validation, test sets of 5800(80.00%), 725(10.00%),
725(10.00%).

Table 1. Datasets Statics Dataset | Node | Edge | Metapath
---|---|---|---
DBLP |  | author(A):4057
---
paper(P):14328
conference(C):20
| P-A:19645
---
P-C:14328
| APA
---
APCPA
Amazon | Product(P):3475 |  | P$\stackrel{{\scriptstyle viewing}}{{\longrightarrow}}$P:2683
---
P$\stackrel{{\scriptstyle purchasing}}{{\longrightarrow}}$P:791
| P$\stackrel{{\scriptstyle 1}}{{\longrightarrow}}$P
---
P$\stackrel{{\scriptstyle 2}}{{\longrightarrow}}$P
Alibaba |  | user(U):2785
---
item(I):2780
video(V):2716
| U-I:2935
---
I-V:1380
U-V:2935
I-I:8569
| UIU
---
UIVIU
UVU
IUI
IUVUI
IVI
IIUIUVUVUI
IVIVIVIUII
IUIIUVUVUI

###  5.2. Comparing Methods

We categorize different graph embedding methods into four groups and compare
MHN against these methods. The overall embedding size is set to 200.

Homogeneous Graph Embedding Methods. The compared methods include Deepwalk[5],
LINE[15] and node2vec[6]. As these methods can only deal with Homogeneous
graph, so we ignore the heterogeneity of graph and treat datasets as
homogeneous.

  * •

Deepwalk is a approach for learning latent representations of vertices in a
network, using random walks to learn embeddings by treating walks as the
equivalent of sentences.

  * •

LINE optimizes a objective function that preserves both the local and global
network structures using proposed edge-sampling algorithm.

  * •

Node2vec is an algorithm framework for learning continuous feature
representations for nodes in homogeneous network. We unify the feature of
different kinds of nodes into the same dimension.

Table 2. Performance comparison (%) on DBLP dataset for node classification task Dataset | Metrics | Train(%) | Unsupervised | Supervised
---|---|---|---|---
Deepwalk | Node2vec | LINE | Metapath2vec | GCN | GAT | HAN | MHN
DBLP | Micro-F1 | 20 | 84.35 | 89.71 | 88.61 | 89.49 | 89.76 | 90.31 | 91.23 | 92.16
40 | 86.35 | 89.85 | 89.12 | 90.31 | 90.43 | 90.91 | 91.75 | 92.48
60 | 86.49 | 90.13 | 89.68 | 90.53 | 90.82 | 91.05 | 92.01 | 92.94
80 | 86.86 | 90.88 | 89.75 | 91.01 | 90.83 | 91.18 | 92.37 | 93.29
Macro-F1 | 20 | 82.49 | 89.27 | 88.36 | 88.97 | 89.61 | 89.68 | 90.75 | 91.37
40 | 82.59 | 89.96 | 88.52 | 90.03 | 89.74 | 89.74 | 90.96 | 91.65
60 | 82.97 | 90.06 | 89.23 | 90.17 | 90.19 | 89.75 | 91.37 | 92.02
80 | 85.27 | 90.25 | 89.42 | 90.62 | 90.56 | 90.69 | 91.89 | 92.31

Homogeneous GNNs. These models focus on the structure of network and use graph
convolution method to obtain information, including GCN[7] and GAT[8]. We test
these models on metapath-based homogeneous graph and select the best result.

  * •

GCN obtains information through convolutional operations in Fourier domain for
semi-supervised learning.

  * •

GAT adopts attention mechanism to perform convolution in the homogeneous graph
through masked self attention layer.

Heterogeneous Graph Embedding Methods. The compared methods include
Metapath2vec[10]. These methods focus on the generation of node embedding in
heterogeneous graph.

  * •

Metapath2vec adopts metapath-guided random walk to generate train sentences
and feed them into skip-gram model and generate node embedding. We test
multiple metapaths and select the best result.

Heterogeneous GNNs. These methods include HAN[12] and GATNE[13]. Due to the
the precise capture of heterogeneous information, they perform well in
heterogeneous graph.

  * •

HAN uses attention mechanism to combine embeddings from different metapath-
guided graph into one vector, capturing information from different emtapath.

  * •

GATNE focuses on the combination of different types of edges using attention
mechanism. We test several GATNE variants and choose the best model.

For skip-gram based models, like Deepwalk, LINE, Node2vec, Metapath2vec, we
set the window size to 5, walk length to 10, walks per node to 20, and number
of negative samples to 5\. For GNNs, including GCN, GAT, HAN, GATNE, we apply
Adam optimization with learning rate set to 0.01. These models are trained for
100 epochs and early stopping is set to 5. For models with attention
mechanism, we set the number of attention head to 8 and attention dimension to
100.

###  5.3. Node Classification

We conduct experiment on the DBLP dataset to compare the performance of
different methods on node classification task. We send node embeddings
generated by different learning models into the Logistic Regression(LR)
classifier with varying training proportions. In order to ensure fairness, all
the data used for comparison comes from the test set, which both supervised
learning and unsupervised methods have not trained. We compare the average
Macro-F1 and Micro-F1 of different methods in Table 2.

As shown in Table 2, under different training proportions of DBLP dataset, MHN
can achieve the best results over other learning methods. It is worth noting
that, whether it is supervised or unsupervised learning, the method based on
random walk performs better than the these based on GNN. This is because the
DBLP dataset pays more attention to the connections between nodes, rather than
the nodes themselves. Our method not only fully considers the global
information, but also premeditates the local information, which ensures that
the node embedding contains rich semantic information. The performance gain
obtained by MHN over the best baseline(HAN) is about 0.42%-0.93% absolutely.

###  5.4. Link Prediction

Link prediction task is widely used to evaluate the quality of graph
embeddings in both academia and industry. We also conduct experiments on the
Amazon and Alibaba datasets. We hide a set of edges as the test set and train
on the remaining graph. For unsupervised learning models, we treat the
connected links as positive node pairs and unconnected links as negative node
pairs by minimizing the objective function described in Equation 14. Given the
embedding $z_{u}$ and $z_{v}$, we calculate the probability that $u$ and $v$
are linked as following:

(15) $p_{u,v}=\sigma(z_{u}\cdot z_{v})$

We use some commonly used metrics like the ROC curve(ROC-AUC), the PR
curve(PR-AUC), the average precision(AP) and the F1 score.

Table 3. Experiment results (%) on Amazon and Alibaba datasets for link prediction task | Amazon | Alibaba
---|---|---
ROC-AUC | PR-AUC | F1 | AP | ROC-AUC | PR-AUC | F1 | AP
Deepwalk | 89.01 | 87.35 | 64.76 | 59.28 | 73.69 | 73.11 | 66.46 | 73.14
Node2vec | 88.96 | 87.29 | 66.12 | 57.83 | 73.83 | 72.95 | 67.01 | 71.29
LINE | 88.83 | 86.49 | 62.28 | 62.75 | 67.18 | 72.93 | 61.98 | 70.56
Metapath2vec | 90.56 | 88.69 | 71.95 | 70.65 | 77.92 | 73.54 | 70.94 | 75.17
GCN | 87.09 | 86.11 | 67.74 | 66.35 | 76.38 | 72.56 | 67.12 | 73.14
GAT | 88.73 | 88.64 | 69.91 | 67.33 | 76.84 | 72.26 | 67.54 | 73.87
HAN | 89.32 | 88.66 | 70.51 | 70.12 | 73.14 | 73.03 | 68.04 | 74.01
GATNE | 89.27 | 88.04 | 69.79 | 70.06 | 74.11 | 72.89 | 68.23 | 73.91
MNH | 92.02 | 89.81 | 73.15 | 71.46 | 79.37 | 74.92 | 71.85 | 75.38

From Table 3, we can see that MHN performs better than other comparison
algorithms. The strongest traditional method here is Metapath2vec, which
learns embedding from node sequences generated by random walk guided by one
metapath. MHN achieves better scores than Metapath2vec, proving the importance
of multiple semantics of heterogeneous graph. Based on the idea of multi-
semantics fusion, MHN considers the influence of BFS and DSF neighbors of the
target node, which helps achieve a relative improvement of around 8% on
Alibaba dataset over HAN. This result supports our claim that local and global
information are critical to the node embeddings.

###  5.5. Parameter Sensitivity

We investigate the sensitivity of hyper-parameter in MHN, mainly the effect of
embedding dimension. Figure 3 illustrates the performance of different methods
when the embedding dimension changes. We can see that as the embedding
dimension increases, the performance of models also increases, but the it
drops when embedding dimension is either too small or too large. It can be
conclude that the performance of MHN is relatively stable within the range of
embedding dimensions. Since the heterogeneous information cannot be
identified, Deepwalk and GCN performs the worst.

Figure 3: The performance of different methods on Amazon dataset when changing
embedding dimensions.

###  5.6. Visualization

In addition to quantitative analysis of node embedding, we also adopt
visualization method to qualitatively assess node embedding results. We
randomly select four categories from DBLP dataset with 25 items under each
category, and then project the embeddings of these nodes into a 2-dimensional
space using t-SNE. We illustrate the visualization results of Deepwalk,
Metapath2vec, HAN and MHN in Figure 4, where red and blue points indicate
different category respectively.

Through visualization, we can intuitively tell the differences among learning
ability of graph embedding methods for heterougeneous graph. As a traditional
homogeneous graph representation learning method, Deepwalk cannot effectively
divide these nodes into four groups. On the contrary, the heterogeneous model
Metapah2vec can roughly distinguish these nodes. Because HAN fuse multiple
semantics into node embedding, it achieves better performance. MHN method
proposed in paper obtains the best embedding results, in which only a few
nodes have errors and most of them are completely separated.

(a) Deepwalk

(b) Metapath2vec

(c) HAN

(d) MHN

Figure 4: Embedding visualization of nodes in DBLP.

###  5.7. Online A/B Test

We deploy our inductive model MHN on Alibaba mobile application for it’s
recall process of recommendation system. The training dataset has about half a
million users and videos, a million items, with 3 million interactions among
these nodes. We adopt MHN to generate embedding of each node under several
metapaths. For each item, we apply K nearest neighbor (KNN) with Euclidean
distance to obtain the top-50 videos that are most similar to the current
item. Taking top-50 hit-rate as a goal, we compared the original method based
on item-CF, Metapath2vec and MHN. The results demonstrate that MHN improves
hit-rate by 2.93% and 6.71% compared to Metapath2vec and item-CF methods,
respectively.

##  6\. Conclusion

In this paper, we propose a metapaths-guided neighbors-aggregated
Heterogeneous Graph Neural Network(MHN) method for heterogeneous graph node
embedding learning, which can address three limitations mentioned above. MHN
applies node base embedding to transform node attributes and enrich node
representation. In addition, aggregation within metapath can merge BFS and DFS
neighbors to obtain local and global information of the target node,
respectively. Finally, MHN adopts attention based algorithm in aggregation
among metapaths to capture information in different semantics. Especially, we
put forward several encode functions for neighbors aggregation and self-
attention mechanism for vectors aggregation. In experiments, MHN achieves best
results on three real-world datasets in node classification and link
prediction task. Parameter sensitivity analysis illustrates the effect of
embedding dimension. Visualization analysis shows the quality of node
representation obtained by different methods directly. Online test in Alibaba
mobile application proves the feasibility and effectiveness of MHN.

For the future work, we will consider about the dynamic heterogeneous graph
node representation learning methods to adapt the changes in graph.

## References

  * (1) Jagadish S, Parikh J. Discovery of friends using social network graph properties: U.S. Patent 8,744,976[P]. 2014-6-3.
  * (2) Kipf T N, Welling M. Variational graph auto-encoders[J]. arXiv preprint arXiv:1611.07308, 2016.
  * (3) Nickel M, Murphy K, Tresp V, et al. A review of relational machine learning for knowledge graphs[J]. Proceedings of the IEEE, 2015, 104(1): 11-33.
  * (4) Ying R, He R, Chen K, et al. Graph convolutional neural networks for web-scale recommender systems[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2018: 974-983.
  * (5) Perozzi B, Al-Rfou R, Skiena S. Deepwalk: Online learning of social representations[C]//Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining. 2014: 701-710.
  * (6) Grover A, Leskovec J. node2vec: Scalable feature learning for networks[C]//Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining. 2016: 855-864.
  * (7) Kipf T N, Welling M. Semi-supervised classification with graph convolutional networks[J]. arXiv preprint arXiv:1609.02907, 2016.
  * (8) Veličković P, Cucurull G, Casanova A, et al. Graph attention networks[J]. arXiv preprint arXiv:1710.10903, 2017.
  * (9) Hamilton W, Ying Z, Leskovec J. Inductive representation learning on large graphs[C]//Advances in neural information processing systems. 2017: 1024-1034.
  * (10) Dong Y, Chawla N V, Swami A. metapath2vec: Scalable representation learning for heterogeneous networks[C]//Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining. 2017: 135-144.
  * (11) Shi C, Hu B, Zhao W X, et al. Heterogeneous information network embedding for recommendation[J]. IEEE Transactions on Knowledge and Data Engineering, 2018, 31(2): 357-370.
  * (12) Wang X, Ji H, Shi C, et al. Heterogeneous graph attention network[C]//The World Wide Web Conference. 2019: 2022-2032.
  * (13) Cen Y, Zou X, Zhang J, et al. Representation learning for attributed multiplex heterogeneous network[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2019: 1358-1368.
  * (14) Wang J, Huang P, Zhao H, et al. Billion-scale commodity embedding for e-commerce recommendation in alibaba[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2018: 839-848.
  * (15) Tang J, Qu M, Wang M, et al. Line: Large-scale information network embedding[C]//Proceedings of the 24th international conference on world wide web. 2015: 1067-1077.
  * (16) Wang D, Cui P, Zhu W. Structural deep network embedding[C]//Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining. 2016: 1225-1234.
  * (17) Fu T, Lee W C, Lei Z. Hin2vec: Explore meta-paths in heterogeneous information networks for representation learning[C]//Proceedings of the 2017 ACM on Conference on Information and Knowledge Management. 2017: 1797-1806.
  * (18) Zhang C, Song D, Huang C, et al. Heterogeneous graph neural network[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 2019: 793-803.
  * (19) Liu B, Pop M. MetaPath: identifying differentially abundant metabolic pathways in metagenomic datasets[C]//BMC proceedings. BioMed Central, 2011, 5(2): 1-12.
  * (20) Du Y, Guo W, Liu J, et al. Classification by multi-semantic meta path and active weight learning in heterogeneous information networks[J]. Expert Systems with Applications, 2019, 123: 227-236.
  * (21) Fu X, Zhang J, Meng Z, et al. MAGNN: Metapath Aggregated Graph Neural Network for Heterogeneous Graph Embedding[C]//Proceedings of The Web Conference 2020. 2020: 2331-2341.
  * (22) Cai H, Zheng V W, Chang K C C. A comprehensive survey of graph embedding: Problems, techniques, and applications[J]. IEEE Transactions on Knowledge and Data Engineering, 2018, 30(9): 1616-1637.
  * (23) Gao J, Liang F, Fan W, et al. Graph-based consensus maximization among multiple supervised and unsupervised models[C]//Advances in Neural Information Processing Systems. 2009: 585-593.
  * (24) Qi L, Zhang X, Dou W, et al. A distributed locality-sensitive hashing-based approach for cloud service recommendation from multi-source data[J]. IEEE Journal on Selected Areas in Communications, 2017, 35(11): 2616-2624.
  * (25) Wang C, Song Y, Li H, et al. Unsupervised meta-path selection for text similarity measure based on heterogeneous information networks[J]. Data Mining and Knowledge Discovery, 2018, 32(6): 1735-1767.