# 在线游戏中的交易网络子图匹配

## 课题背景

交易是游戏世界中普遍存在的行为，大量玩家之间的交易行为能够形成一个客观存在的图网络结构，即交易网络。游戏工作室通过大量游戏账号在游戏中转移、出售游戏资产来谋取巨额利益，因此异常交易检测是游戏中一个非常重要的反外挂手段。

然而，目前异常交易检测中的“异常”在数据上并没有一个天然的定义。我们往往是先有对事实的认知，并基于认知定下了一系列的“法条”，以此来“定义”异常。并且，这些定义往往是掌握在对游戏本身更了解的运营和游戏手中，AI模型得出的结果很难被直接使用。

因此，异常交易检测可以形式化成一个图论中的近似子图匹配问题，如图1所示，用已知的异常交易图结构作为查询图，搜索目标图（交易网络）中相似的子图。基于这种解决方案，不需要考虑异常的定义和解释这两个难题，只需要把图搜索工具提供给用户，让用户自己解决问题。

## 问题定义

给定一个具有较大规模的交易网络（即目标图）和一个具有较小规模的交易子图（即查询图），输出目标图中和查询图匹配的子图集合。

![图1：在线游戏中的交易网络子图匹配示意图](https://noterminus.gitee.io/image_bed/images/subgraph_matching.png)

## 问题挑战

相比于一般的子图匹配问题，该问题的挑战为：

* 由于游戏中的图结构规模较大，因此搜索效率是一个重要的度量
* 传统的子图匹配一般形式化为一个二分类问题，即G中是否存在Q或者类似Q的子图。在此基础上，我们需要输出具体的子图或者候选子图集合
* 能够给定输出图集合中各个输出图和查询图的相似度，作为排序的依据

## 评价指标

可以参考常用的推荐排序指标进行评估：

* TOP-K精确率：precision\@K
* TOP-K召回率：recall\@K
* TOK-K时间开销：time\@K

## 数据集描述

数据集包含目标图交易网络数据和多个查询图交易网络数据，具体描述如下所示：

* 目标图，交易网络数据

| 字段            | 类型     | 描述                                          |
| ------------- | ------ | ------------------------------------------- |
| ts            | bigint | 时间戳                                         |
| type          | bigint | 交易类型，例如摆摊交易、当面交易等                           |
| role\_id\_src | string | 玩家ID（发起方）                                   |
| role\_id\_dst | string | 玩家ID（接受方）                                   |
| item\_src     | string | 交易商品（发起方），格式：\[(商品1, 数量1), (商品2, 数量2), ...] |
| item\_dst     | string | 交易商品（接受方），格式：\[(商品1, 数量1), (商品2, 数量2), ...] |
| amt\_src      | bigint | 交易金额（发起方）                                   |
| amt\_dst      | bigint | 交易金额（接受方）                                   |

* 目标图，交易网络数据

| 字段            | 类型     | 描述                                          |
| ------------- | ------ | ------------------------------------------- |
| ts            | bigint | 时间戳                                         |
| type          | bigint | 交易类型，例如摆摊交易、当面交易等                           |
| role\_id\_src | string | 玩家ID（发起方）                                   |
| role\_id\_dst | string | 玩家ID（接受方）                                   |
| item\_src     | string | 交易商品（发起方），格式：\[(商品1, 数量1), (商品2, 数量2), ...] |
| item\_dst     | string | 交易商品（接受方），格式：\[(商品1, 数量1), (商品2, 数量2), ...] |
| amt\_src      | bigint | 交易金额（发起方）                                   |
| amt\_dst      | bigint | 交易金额（接受方）                                   |

## 联系我们

有任何问题，请联系 <zhaoshiwei@corp.netease.com>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fuxi-up-research.gitbook.io/open-project/research_topics/trade_subgraph_matching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
