Return-Path: X-Original-To: apmail-giraph-user-archive@www.apache.org Delivered-To: apmail-giraph-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 858E0109CF for ; Wed, 26 Feb 2014 21:05:09 +0000 (UTC) Received: (qmail 45751 invoked by uid 500); 26 Feb 2014 21:05:08 -0000 Delivered-To: apmail-giraph-user-archive@giraph.apache.org Received: (qmail 45702 invoked by uid 500); 26 Feb 2014 21:05:08 -0000 Mailing-List: contact user-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@giraph.apache.org Delivered-To: mailing list user@giraph.apache.org Received: (qmail 45694 invoked by uid 99); 26 Feb 2014 21:05:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 21:05:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ssc.open@googlemail.com designates 209.85.215.178 as permitted sender) Received: from [209.85.215.178] (HELO mail-ea0-f178.google.com) (209.85.215.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 21:05:00 +0000 Received: by mail-ea0-f178.google.com with SMTP id a15so1313996eae.9 for ; Wed, 26 Feb 2014 13:04:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=FSrjr3IIuCxNCu4ptrogFeej7gj0uWtJDSvDEIM14y0=; b=HSPqTxPT2Zy5STB+taeiTWpNOlI3s81TKKhhEYtU4Yhd5/TZHzykTxGngDp1nbG3yB RVUhyoyS652nidB/Hjg6S6lNWNJh9qPU/hoUSRNTcfIz+ZpPn3EGB1knRo2dswsGgzaD ip8C3R/yMCZr6GhzLIpF5Adk2EblidG1XuXLfMs1jmjWbbbqpXL4wlnDOs0WuaINlew+ QRghtpq0W3+pC6y6bVA73N9aJyn2H61/jBUzw3YtgoZBOey1yenpRzbgwO2y6kGsDPEX Uoc8kYWsKeCbhamFACVJLy/wPto50GY/PDZwJrhTZuQJ+/HxNXl8qQDL9L0u0i815XTI veoA== X-Received: by 10.14.99.196 with SMTP id x44mr9078355eef.65.1393448680468; Wed, 26 Feb 2014 13:04:40 -0800 (PST) Received: from [192.168.0.2] (e179171010.adsl.alicedsl.de. [85.179.171.10]) by mx.google.com with ESMTPSA id m9sm8233416eeh.3.2014.02.26.13.04.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 13:04:39 -0800 (PST) Message-ID: <530E56E6.9090408@apache.org> Date: Wed, 26 Feb 2014 22:04:38 +0100 From: Sebastian Schelter Reply-To: ssc@apache.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: user@giraph.apache.org Subject: Re: pagerank in giraph. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Suijian, Giraph has several PageRank implementations. I suggest that you use org.apache.giraph.examples.PageRankComputation which will automatically check convergence for you and correctly handle dangling vertices (vertices without any outlinks). It relies on org.apache.giraph.examples.LongDoubleNullTextInputFormat which expects a very simple text file. The format is one line per vertex with the id of the vertex followed by the ids of adjacent vertices: src_vertex_id dest_vertex_id_1 dest_vertex_id_2 ... See org.apache.giraph.examples.PageRankComputationTest for an example of how to configure it. It needs org.apache.giraph.examples.RandomWalkWorkerContext as worker context and org.apache.giraph.examples.RandomWalkVertexMasterCompute as master compute. Best, Sebastian On 02/26/2014 09:09 PM, Suijian Zhou wrote: > Hi, > To load and compute the pagerank of the following graph format(common in > social network graphs): > > Src_vertex_id_1 Dest_vertex_id_2 Dest_vertex_id_3 (v1->v2, v1->v3) > Src_vertex_id_2 Dest_vertex_id_4 Dest_vertex_id_5 Dest_vertex_id_6 (v2->v4, > v2->v5, v2->v6) > ..... > > Should I have to convert the above input format into the following so as to > be compatible with giraph? > > [Src_vertex1_id_1, 1, [[Dest_vertex_id_2,0],[Dest_vertex_id_3,0]]] > [Src_vertex1_id_2, 1, > [[Dest_vertex_id_4,0],[Dest_vertex_id_5,0],[Dest_vertex_id_6,0]]] > ...... > > I.e, to set initial vertex values to 1 and edge values to 0? Thanks! > > Best Regards, > Suijian >