DAG中的可达性测试指数(有向无环图)?

时间:2018-06-13 21:50:17

标签: reachability directed-acyclic-graphs

假设我有一个DAG,例如:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.MapRoute(
        name: "UserIdRoute",
        url: "{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

public ActionResult Index(string id)
{
    //Get users profile from the database using the id
    var viewModel = _userProfileService.Get(id);

    return View();
}

是否存在可以执行的索引,可以让我有效地判断节点是否可以从另一个节点访问(在<< O(边缘)中):

A->C
A->D
B->C
B->E
D->F
C->F
C->G
E->G
F->H
G->H

0 个答案:

没有答案