Skip to content

Instantly share code, notes, and snippets.

@Thesharing
Last active July 20, 2017 03:57
Show Gist options
  • Save Thesharing/95647422b4e054a4ccd0d37c3770d218 to your computer and use it in GitHub Desktop.
Save Thesharing/95647422b4e054a4ccd0d37c3770d218 to your computer and use it in GitHub Desktop.
编程之美 2016 复赛试题翻译

目录

译文

题目

微软学术图表(MAG, Microsoft Academic Graph)是一个大型异构图,其中包含了作者,论文,期刊,会议等实体以及他们之间的关系。微软为这次比赛提供了学术知识API。实体属性的定义在这里查阅。

参赛者应提交一个REST服务终端(endpoint)。给定一对MAG中的实体标识符(entity indentifier),你的REST服务终端可以找到连接这对实体标识符的所有1跳(1-hop)、2跳和3跳的路径(graph path)。给定的实体标识符对(pair)可以是[Id, Id]、[Id, AA.AuId]、[AA.AuId, Id]或者[AA.AuId, AA.AuId]。路径上的每一个点(node)都应该是以下标识符的一种:Id、F.Fid、J.JId、C.CId、AA.AuId或AA.AfId。一条路径可能存在的边(一对相邻的点相连形成)(edge)有:

路径的定义

对于每一个测试用例,REST服务终端会通过HTTP收到一个含有一对实体标识符的JSON数组,其中标识符是64位整数(64-bit integer),例如[123,456]。服务终端需要在300秒内回复一个JSON数组。回复的JSON数组里包含一个形如[path1, path2, ..., pathn]的路径列表(a list of graph paths),其中每一个路径(path)都是一个实体标识符数组。 例如,如果你的程序找到了一个1跳的路径,两个2跳的路径,以及一个3跳的路径,那么结果可能看起来就像这样:[ [123, 456], [123, 2, 456], [123, 3, 456], [123, 4, 5, 456] ]。对于路径[123, 4, 5, 6],这些整数就是路径(path)上实体(entity)的标识符(indentifier)。收到REST服务终端回复的JSON数组以后,评估器(evaluator)会随机等待一段时间然后发送下一个请求。

评估标准

在复赛中,REST服务必须被部署在一个Stadard_A3虚拟机上。比赛对使用的编程语言没有限制。 在最终评估之前测试用例都将不可用。当评估开始时,评估器系统(the evaluator system)会将测试用例分别发送至每一个队伍的的REST终端。每一个队伍会收到10个测试用例(Q1到Q10)。对测试用例Qi的响应时间记为Ti(1≤i≤10)。最终得分的计算公式为:

得分计算公式

其中Ni是测试用例Qi的正确路径的总数量,Ki是REST服务返回的总路径数量,Mi是REST服务返回的正确路径数量(不计重复)。

原文

Problem Description

Microsoft Academic Graph (MAG) is a large heterogeneous graph containing entities such as authors, papers, journals, conferences and relations between them. Microsoft provides Academic Knowledge API for this contest. The Entity attributes are defined here.

Participants are supposed to provide a REST service endpoint that can find all the 1-hop, 2-hop, and 3-hop graph paths connecting a given pair of entity identifiers in MAG. The given pair of entity identifiers could be [Id, Id], [Id, AA.AuId], [AA.AuId, Id], [AA.AuId, AA.AuId]. Each node of a path should be one of the following identifiers: Id, F.Fid, J.JId, C.CId, AA.AuId, AA.AfId. Possible edges (a pair of adjacent nodes) of a path are:

Possible Edges

For each test case, the REST service endpoint will receive a JSON array via HTTP with a pair of entity identifiers, where the identifiers are 64-bit integers, e.g. [123, 456]. The service endpoint needs to respond with a JSON array within 300 seconds. The response JSON array consists of a list of graph paths in the form of [path1, path2, …, pathn], where each path is an array of entity identifiers. For example, if your program finds one 1-hop paths, two 2-hop paths, and one 3-hop paths, the results may look like this: [ [123,456], [123,2,456], [123,3,456], [123,4,5,456] ]. For a path such as [123,4,5,456], the integers are the identifiers of the entities on the path. After receiving the response, the evaluator will wait for a random period of time before sending the next requests.

Evaluation Metric

The REST service must be deployed to a Standard_A3 virtual machine for the final test. There are no constraints on the programming language you can use.

The test cases are not available before the final evaluation. When the evaluation starts, the evaluator system sends test cases to the REST endpoint of each team individually. Each team will receive 10 test cases (Q1to Q10). The response time for test case Qi is recorded as Ti(1≤i≤10). The final score is calculated using:

Evaluation Metric

where Ni is the size of the solution (the total number of correct paths) for Qi , Ki is the total number of paths returned by the REST service, Mi is the number of distinct correct paths returned by the REST service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment